Returns a tibble containing the titles, publication date, observation periods, data source, metadata url and download urls of available BFS datasets in a given language which match the given criteria. This function leverages the R base function grepl but calls the data argument first to allow the use of the pipe operator from magrittr.

bfs_search(
  data = bfs_get_metadata(),
  pattern,
  ignore.case = TRUE,
  fixed = FALSE
)

Arguments

data

The data frame to search. This can be either a data frame previously fetched using bfs_get_metadata (recommended) or left blank, in which case a temporary data frame is fetched. The second option adds a few seconds to each search query.

pattern

A regular expression string to search for.

ignore.case

Whether the search should be case-insensitive.

fixed

logical. If TRUE, pattern is a string to be matched as is.

Value

A data frame.

See also

Examples

meta_en <- bfs_get_metadata(language = "en") bfs_search(data = meta_en, pattern = "university students")
#> # A tibble: 2 x 6 #> title observation_peri… published source url_bfs url_px #> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 University s… 1980-2019 25.03.2020 Federal… https://www.b… https://ww… #> 2 University s… 1990-2019 25.03.2020 Federal… https://www.b… https://ww…