bfs_get_sse_data: Get Data from Swiss Stats Explorer (SSE) API

View source: R/bfs_get_sse_data.R

bfs_get_sse_dataR Documentation

Get Data from Swiss Stats Explorer (SSE) API

Description

Get Data from Swiss Stats Explorer (SSE) API

Usage

bfs_get_sse_data(
  number_bfs,
  language = "de",
  start_period = NULL,
  end_period = NULL,
  query = NULL,
  column_name_type = "code",
  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".

start_period

Start year of the requested data

end_period

End year of the requested data

query

A named list with dimension codes as names and desired values as values.

column_name_type

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

variable_value_type

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

clean_names

Logical, if TRUE, the column names are cleaned using janitor::clean_names().

Value

A tibble with the requested data.

Examples

bfs_get_sse_data(
  number_bfs = "DF_PASTA_552_MONTHLY", 
  language = "en", 
  query =  list("FREQ" = "M", "ACCOMMODATION_TYPE" = c("552001"), 
                "COUNTRY_ORIGIN" = c("CH", "AUSL")),
  start_period = "2020",
  end_period = "2023"
  )

BFS documentation built on Nov. 5, 2025, 6:01 p.m.