bfs_get_data: Get BFS data in a given language

View source: R/bfs_get_data.R

bfs_get_dataR Documentation

Get BFS data in a given language

Description

Get a dataset using the PXWEB API v1. You should choose either the BFS number (FSO number) of the BFS offical url of a given dataset. You can query particulary variables using the 'query' argument.

Usage

bfs_get_data(
  number_bfs = NULL,
  language = "de",
  url_bfs = NULL,
  query = NULL,
  column_name_type = "text",
  variable_value_type = "text",
  clean_names = FALSE
)

Arguments

number_bfs

The BFS number (FSO number) of a dataset.

language

Language of the dataset to be translated if exists, i.e. "de", "fr", "it" or "en".

url_bfs

The URL page of a dataset.

query

A list with named values, a json query file or json query string using pxweb::pxweb_query().

column_name_type

Column name type as "text" or as "code".

variable_value_type

Variable value type as "text" or as "code".

clean_names

Clean column names using janitor::clean_names().

Value

A tbl_df (a type of data frame; see tibble or dplyr packages).

See Also

bfs_get_data_comments


BFS documentation built on Sept. 20, 2023, 5:07 p.m.