View source: R/bfs_get_sse_metadata.R
| bfs_get_sse_metadata | R Documentation |
Deprecated since BFS 0.8.0: use bfs_sse_dimensions() instead. This
function still works and gets only bug fixes, e.g. the labels of codes
with no name in language (see NEWS). To move your code, see the article
Moving to the new Swiss Stats Explorer functions.
Get the dimensions of a dataset of the Swiss Stats Explorer (SSE) API
(https://stats.swiss/) and the values each dimension can take. Use them
to build the query of bfs_get_sse_data().
bfs_get_sse_metadata(number_bfs, language = "de")
number_bfs |
The id of an SSE dataset (dataflow), e.g. |
language |
Language of the labels: |
The list of the SSE datasets is cached for the R session. A long-running
R session, e.g. a Shiny app, keeps using the version of a dataset it saw
first: call bfs_clear_cache() to use a new version, or use
bfs_sse_dimensions(), which caches nothing.
A tibble with one row per value of each dimension:
The dimension code, to use as a name in query.
The dimension label.
The value code, to use as a value in query.
The value label.
The position of the dimension in the dataset.
Returns NULL if there is no internet connection.
Marius Hodel
bfs_sse_dimensions(), bfs_get_sse_data()
codelist <- bfs_get_sse_metadata("DF_LWZ_1", language = "en")
codelist
# the dimensions and their codes
unique(codelist[c("code", "text")])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.