Skip to contents

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

Value

data.frame() with publication metadata of tables.

Details

Setting the catalog to NULL will return all

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))
}