bfs_get_dataset {BFS}R Documentation

Download BFS dataset in a given language

Description

Returns a data frame/tibble from the URL of a given BFS PC-Axis file. The default language is German and the column names are renamed using the clean_names function of the janitor package. If the path of the cache argument is not provided, the downloaded BFS dataset will be saved in the default cache folder of the pins package. The metadata can be accessed by making the downloaded dataset an argument of the base R function attributes().

Usage

bfs_get_dataset(
  url_px,
  language = "de",
  path = pins::board_cache_path(),
  clean_names = TRUE,
  force = FALSE
)

Arguments

url_px

The url link to download the PC-Axis file.

language

Language of the dataset to be translated if exists.

path

The local folder to use as a cache, default to pins cache.

clean_names

Clean column names using janitor::clean_names()

force

Force download to download data even if already downloaded today.

Details

The BFS data is saved in a local folder using the pins package. The function allows to download the BFS data only once per day. If the data has alread been downloaded during the day, the existing dataset is loaded into R from the pins caching folder instead of downloading again the data from the BFS website.

See Also

bfs_get_metadata


[Package BFS version 0.3.1 Index]