Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/edwindj/cbsodataR

Statistics Netherlands (CBS) OpenData API Client for R
https://github.com/edwindj/cbsodataR

cbs census-data officialstatistics opendata r statistics-netherlands

Last synced: 5 days ago
JSON representation

Statistics Netherlands (CBS) OpenData API Client for R

Awesome Lists containing this project

README

        

---
output: rmarkdown::github_document
---

```{r, include=FALSE}
library(dplyr)
```

# Statistics Netherlands (www.cbs.nl) opendata API client for R

[![version](http://www.r-pkg.org/badges/version/cbsodataR)](https://CRAN.R-project.org/package=cbsodataR)
![downloads](http://cranlogs.r-pkg.org/badges/cbsodataR)
[![R build status](https://github.com/edwindj/cbsodataR/workflows/R-CMD-check/badge.svg)](https://github.com/edwindj/cbsodataR/actions)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/edwindj/cbsodatar?branch=master)](https://ci.appveyor.com/project/edwindj/cbsodatar)

Retrieve data and spatial maps from the [open data interface](http://www.cbs.nl/nl-NL/menu/cijfers/statline/open-data/default.htm) (dutch) of Statistics Netherlands (cbs.nl) with *R*.

# Installation

From CRAN
```S
install.packages("cbsodataR")
```

The latest development version of `cbsodata` can installed using `devtools`.

```R
devtools::install_github("edwindj/cbsodataR")
```

# Usage

Retrieve a table of contents with all SN tables.

```{r}
library(cbsodataR)
ds <- cbs_get_datasets("Language" = "en")
head(ds)
```

or do a search:

```{r}
res <- cbs_search("apple", language="en")
res[1:3, c(1:4)]
```

Use the `Identifier` from tables to retrieve table information

```{r}
cbs_get_meta('71509ENG')
```
Or download data.

```{r}
library(dplyr) # just for example's sake
apples <- cbs_get_data("71509ENG")

apples |>
select(1:4)
```

add label columns:

```{r}
apples |>
cbs_add_label_columns() |>
select(1:4)
```

For more information, see `vignette("cbsodataR")`

Python user? Use [cbsodata](https://github.com/J535D165/cbsodata).