Skip to contents

Search a opendata table using free text search.

Usage

cbs4_search(
  query,
  catalog = "CBS",
  language = "nl-nl",
  convert_dates = TRUE,
  verbose = getOption("cbsodata4.verbose", FALSE),
  base_url = getOption("cbsodata4.base_url", BASEURL4)
)

Arguments

query

character with the text to searched for

catalog

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

language

character language of the catalog, currently only Dutch

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 same format as cbs4_get_datasets() plus extra $rel column with the search score.

Note

The search engine currently searches in the odata3 data collection, but uses the Identifiers to find tables in the odata4 data collection.

Examples

if (interactive()){

  ds_nl <- cbs4_search("geboorte", language="nl-nl")
  ds_nl[1:3, c("Identifier", "Title", "rel")]

  bike_tables <- cbs4_search("fiets")
  bike_tables[1:10, c("Identifier", "Title", "rel")]
}