cbs4_get_datasets: Get available datasets

View source: R/cbs4_get_datasets.R

cbs4_get_datasetsR Documentation

Get available datasets

Description

Get the available datasets from open data portal statline.

Usage

cbs4_get_datasets(
  catalog = "CBS",
  convert_dates = TRUE,
  verbose = getOption("cbsodata4.verbose", FALSE),
  base_url = getOption("cbsodata4.base_url", BASEURL4)
)

cbs4_get_toc(
  catalog = "CBS",
  convert_dates = TRUE,
  verbose = getOption("cbsodata4.verbose", FALSE),
  base_url = getOption("cbsodata4.base_url", BASEURL4)
)

Arguments

catalog

only show the datasets from that catalog. If NULL all datasets of all catalogs will be returned.

convert_dates

Converts date columns in Date-Time type (in stead of character)

verbose

Should the url request be printed?

base_url

base url of the CBS OData 4 API

Details

Setting the catalog to NULL will return all

Value

data.frame() with publication metadata of tables.

Note

the datasets are downloaded only once per R session and cached. Subsequent calls to cbs4_get_datasets will use the results of the first call.

See Also

Other datasets: cbs4_get_catalogs()

Examples

if (interactive()){
  # retrieve the main datasets (catalog = "CBS")
  ds <- cbs4_get_datasets()
  print(nrow(ds))

  # see cbs4_get_catalogs() to retrieve all catalogs
  ds_asd <- cbs4_get_datasets(catalog = "CBS-asd")
  print(nrow(ds_asd))

  ds_all <- cbs4_get_datasets(catalog = NULL)
  print(nrow(ds_all))
}

statistiekcbs/cbsccb documentation built on April 8, 2022, 2:38 a.m.