| bfs_sse_dimensions | R Documentation |
Get the dimensions of a dataset of the Swiss Stats Explorer (SSE) API
(https://stats.swiss/) and the values allowed in each dimension. Use
them to build the filters of bfs_sse_data().
bfs_sse_dimensions(dataset, ..., language = "de", version = NULL)
dataset |
The id of a dataset, e.g. |
... |
These dots are for future extensions and must be empty: the
arguments after |
language |
Language of the labels: |
version |
Version of the dataset, e.g. |
A tibble with one row per value allowed in each dimension (some values may have no data):
The dimension id, to use as a name in filters.
The dimension label.
The value code, to use as a value in filters.
The value label.
The position of the dimension in the dataset.
The code of the parent value in the codelist, e.g. the
district of a commune and the canton of a district, or NA. Use it to
select all the values under a value.
Returns NULL if there is no internet connection.
Felix Luginbuhl
bfs_sse_datasets(), bfs_sse_data()
dimensions <- bfs_sse_dimensions("DF_PASTA_552_MONTHLY", language = "en")
dimensions
# the dimensions only
unique(dimensions[c("dimension", "dimension_label")])
# the communes of the canton of Geneva: the values whose parent is a
# district of Geneva
regions <- bfs_sse_dimensions("DF_LWZ_1", language = "en")
districts <- regions$value[regions$parent %in% "GE"]
regions[regions$parent %in% districts, ]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.