MyNixOS website logo
Description

Get Data from the 'KOF Datenservice' API.

Read Swiss time series data from the 'KOF Data' API, <https://datenservice.kof.ethz.ch>. The API provides macro economic time series data mostly about Switzerland. The package itself is a set of wrappers around the 'KOF Datenservice' API. The 'kofdata' package is able to consume public information as well as data that requires an API token.

kofdata - Get Data from the KOF Datenservice API

CRAN_Status_Badge CRAN_time_from_release metacran downloads license

Read Swiss time series data from the KOF Datenservice API. The API provides macroeconomic survey data, business cycle and further macro economic time series about Switzerland. The package itself is a set of wrappers around API. The kofdata package is able to consume public information as well as data that needs an API token.

For further information on the data, the API and the KOF Swiss Economic Institute please consult the corresponding links.

Getting Started - Installation

Official CRAN Version

Fire up R and run install.packages or use the GUI, if you got one.

install.packages("kofdata")

Developer Version from github

The easiest way to install the very latest version that might not have completed all checks (but contains the latest, hottest, most awesome, most exploratory, adventurous features) is to run:

devtools::install_github("KOF-ch/kofdata")

Note to those of you who do not use R regularly: in order to install directly from github make sure the devtools package is installed.

Example Usage

Basic Usage

Read the KOF Barometer into your R Session. The resulting object will be a list of time series objects. In this case it's a named list of length 1 because only a single series was queried.

tsl <- get_time_series("ch.kof.barometer")
length(tsl)
# [1] 1
str(tsl)
# List of 1
# $ ch.kof.barometer: Time-Series [1:368] from 1991 to 2022: 78.3 69.3 69.5 78 77.9 ...

You can also query a vector of time series. In this example we read 3 time series from the KOF labor market index into R.

labor <- get_time_series(
  c(
    "ch.kof.ie.retro.ch_total.ind.d11",
    "ch.kof.ie.retro.ch_total.ass.d11",
    "ch.kof.ie.retro.ch_total.exp.d11"
    )
  )
  
str(labor)  
# List of 3
# $ ch.kof.ie.retro.ch_total.ind.d11: Time-Series [1:117] from 1992 to 2022: -19.4 -26.4 # -22.2 -20.4 -17.8 ...
#  $ ch.kof.ie.retro.ch_total.ass.d11: Time-Series [1:117] from 1992 to 2022: -25.5 -33.5 # -30.5 -30.1 -28.8 ...
# $ ch.kof.ie.retro.ch_total.exp.d11: Time-Series [1:117] from 1992 to 2022: -13.19 -19.31 # -13.96 -10.56 -6.86 ...
  

Metadata

Version

0.2.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows