MyNixOS website logo
Description

R Wrapper to Access a Wide Range of Germany's Federal Statistical System Databases.

A RESTful API wrapper for accessing the GENESIS database of the German Federal Statistical Office (Destatis) as well as its Census Database and the database of Germany's regional statistics. Supports data search functions, credential management, result caching, and handling remote background jobs for large datasets.

restatis

CRANstatus R-CMD-check Codecov testcoverage Lifecycle:experimental

restatis is a wrapper around the RESTful API that provides access to the three main databases of German official statistics:

All functions work on either one of them, on all of them or just on a selection.

Installation

You can install the released version of {restatis} from CRAN:

install.packages("restatis")

Or install the development version of {restatis} from GitHub with:

# install.packages("devtools")
devtools::install_github("CorrelAid/restatis")

Usage

Authentication

To access each one of the APIs, you need to have an account that you can create on the homepage (see links to them above) and store your username and password for use in R with restatis::gen_auth_save() (see ?gen_auth_save for more details). The Zensus 2022 database does support authentication with an API token as well.

Main features

{restatis} provides functions (prefixed with gen_) for finding, exploring, and retrieving data from the three supported APIs. See the “Basic restatis workflow” vignette for an overview of the main features of the package.

In a short overview, there are functions divided in two main parts, searching for (meta)data and retrieving data:

Searching for (meta)data

  • gen_catalogue(): Search the API’s catalogue of data
  • gen_find(): Find objects related to a search term
  • gen_metadata(): Find meta data to an objects
  • gen_alternative_terms(): Find alternative terms to a search term
  • gen_modified_data(): Find out when an object has last been modified
  • gen_objects2stat(), gen_objects2var(), gen_var2stat(), gen_val2var(), gen_val2var2stat() and gen_search_vars(): Find objects, statistics, variables and values related to each other

Retrieving data

  • gen_cube(): Using this function, you can download ‘cube’ objects
  • gen_table(): Using this function, you can download ‘table’ objects
  • gen_list_jobs() and gen_download_job(): Using this function, you can find and download previously created jobs (large tables)

Other functions

  • gen_logincheck(): Perform a logincheck to test your credentials
  • gen_qualitysigns(): Get a list of quality signs (special characters) found in the API’s tables
  • gen_update_evas(): Manually scrape a newer version of the EVAS numbers (official statistic IDs)

Caching

{restatis} uses memoisation to cache query results. This means that if you call a function multiple times with the same input, the values returned the first time are stored and reused from the second time.

Cached objects are stored in the memory and do not persist across R sessions.

Disclaimer

This package is in no way affiliated with the German Federal Statistical Office (Destatis) or the ‘Verbund Statistische Ämter des Bundes und der Länder’. It is a simple wrapper providing R functions to access Destatis’ API. The package authors are in no way responsible for the data that can be retrieved using its functions. The license of this package solely applies to its source code.

Metadata

Version

0.2.0

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