cbs_search: Find tables containing search words

Description Usage Arguments Details Examples

View source: R/cbs_search.R

Description

Find tables containing search words.

Usage

1
2
3
4
5
6
7
8
cbs_search(
  query,
  catalog = "CBS",
  language = "nl",
  format = c("datasets", "docs", "raw"),
  verbose = FALSE,
  ...
)

Arguments

query

character with the words to search for.

catalog

the subset in which the table is to be found, see cbs_get_catalogs(), set to NULL to query all catalogs.

language

should the "nl" (Dutch) or "en" (English) search index be used.

format

format in which the result should be returned, see details

verbose

logical should the communication with the server be shown?

...

not used

Details

The format can be either:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
if (interactive()){
  # search for tables containing the word birth
  
  ds_en <- cbs_search("Birth", language="en")
  ds_en[1:3, c("Identifier", "ShortTitle")]
  
  # or in Dutch
  
  ds_nl <- cbs_search(c("geboorte"), language="nl")
  ds_nl[1:3, c("Identifier", "ShortTitle")]
  
  # Search in an other catalog
  ds_rivm <- cbs_search(c("geboorte"), catalog = "RIVM", language="nl")
  ds_rivm[1:3, c("Identifier", "ShortTitle")]
  
  # search in all catalogs
  ds_all <- cbs_search(c("geboorte"), catalog = NULL, language="nl")

  # docs
  docs <- cbs_search(c("geboorte,sterfte"), language="nl", format="docs")
  names(docs)
  docs[1:2,]
  
  #raw 
  raw_res <- cbs_search(c("geboorte,sterfte"), language="nl", format="raw")
  raw_res
}

cbsodataR documentation built on Jan. 13, 2021, 7:30 p.m.