-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
65 lines (40 loc) · 2.29 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
output:
github_document:
html_preview: false
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo=FALSE, messages=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
library(bonn)
```
# bonn
The R package `bonn` provides functions to retrieve data from the [INKAR database](https://www.inkar.de/) maintained by the Federal Office for Building and Regional Planning (BBSR) in Bonn. The package uses an undocumented JSON API.
### Installation
You can install the package from Github using:
```{r, eval = FALSE}
remotes::install_github("sumtxt/bonn", force=TRUE)
```
### Usage
The main data-retrieving function is `get_data()`. It requires to specify which variable to retrieve and for which geography. By default this function retrieves the data for all available time points and for all available units of a named geography.
For a list of available geographies (municipalities, disricts etc.), call `get_geographies()`. Then use `get_themes()` with the appropriate geography identifier to obtain a list of themes for which variables are available. Then call `get_variables()` for a list of available variables. Not all variables are available for every geography. Use the variable and geography identifier to call `get_data()`. To obtain a detailed description of a variable, call `get_metadata`.
List available themes for districts (Kreise):
```{r}
head( get_themes(geography="KRE") )
```
Indicators for theme "unemployment":
```{r}
head( get_variables(theme="011", geography="KRE") )
```
Retrieve data and metadata on the unemployment variable:
```{r}
head( get_data(variable='12', geography="KRE") )
```
### Notes
- User reports suggest that some IDs of the database are not necessarily stable over time (see https://github.com/sumtxt/bonn/issues/1).
### Complementary Packages
* The R package `wiesbaden` [github.com/sumtxt/wiesbaden](https://github.com/sumtxt/wiesbaden) provides functions to directly retrieve data from databases maintained by the Federal Statistical Office of Germany (DESTATIS) in Wiesbaden
* The R package AGS [github.com/sumtxt/ags](https://github.com/sumtxt/ags/) provides functions to work with the Amtlicher Gemeindeschlüssel (AGS), e.g. construct time series of statistics for Germany's municipalities and districts.