Gets all data via bulk download. cbs_download_data dumps the data in (international) csv format.

cbs_download_data(
  id,
  path = file.path(id, "data.csv"),
  catalog = "CBS",
  ...,
  select = NULL,
  typed = TRUE,
  verbose = FALSE,
  show_progress = interactive() && !verbose,
  base_url = getOption("cbsodataR.base_url", BASE_URL)
)

Arguments

id

of cbs open data table

path

of data file, defaults to "id/data.csv"

catalog

catalog id, can be retrieved with cbs_get_datasets()

...

optional filter statements to select rows of the data,

select

optional names of columns to be returned.

typed

Should the data automatically be converted into integer and numeric?

verbose

show the underlying downloading of the data

show_progress

show a progress bar while downloading.

base_url

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

Specify different server

Besides the official CBS data, there are also third party and preview dataservices implementing the same protocol. The base_url parameter allows to specify a different server. The base_url can either be specified explicitly or set globally with with options(cbsodataR.base_url = "http://example.com"). Some further tweaking may be necessary for third party services, a download url is constructed using: either with:

  • <base_url>/<BULK>/<id>/... for data

  • <base_url>/<API>/<id>/?$format=json for metadata

Default values for BASEURL, BULK and API are set in the package options, but can be changed with:

options(
 cbsodataR.base_url = "https://opendata.cbs.nl",
 cbsodataR.BULK = "ODataFeed/odata",
 cbsodataR.API = "ODataAPI/odata"
)

which are the default values set in the package.