Learn R Programming

cbsodataR (version 0.3)

get_data: Get data from Statistics Netherlands (CBS)

Description

Retrieves data from a table of Statistics Netherlands. A list of tables can be retrieved with get_table_list. Optionaly the data can be filtered on category values. The filter is specified with <column_name> = <values> in which <values> is a character vector. Rows with values that are not part of the character vector are not returned. Note that the values have to be raw (un-recoded) values.

Usage

get_data(id, ..., recode = TRUE, use_column_title = recode,
  dir = tempdir(), base_url = CBSOPENDATA)

Arguments

id

Identifier of table, can be found in get_table_list

...

optional filter statemenets

recode

Should the categories of the table be recoded with their title (TRUE) or with their key (FALSE)?

use_column_title

Should column names be coded with title (TRUE) or key (FALSE)

dir

Directory where the table should be downloaded. Defaults to temporary directory

base_url

optionally specify a different server. Useful for third party data services implementing the same protocol.

Value

data.frame with the requested data. Note that a csv copy of the data is stored in dir.

Examples

Run this code
# NOT RUN {
# get data for main (000000) Consumer Price Index (7196ENG) for March 2000, 
 get_data(id="7196ENG", Periods="2000MM03", CPI="000000")
# }

Run the code above in your browser using DataLab