View source: R/bfs_get_catalog_tables.R
| bfs_get_catalog_tables | R Documentation |
Search the tables of the BFS catalog
(https://www.bfs.admin.ch/bfs/en/home/statistics/catalogue.html, article
type "Tables"). Tables are mostly Excel or CSV files, not available in the
PXWeb API: download them with bfs_download_asset().
bfs_get_catalog_tables(
language = "de",
title = NULL,
extended_search = NULL,
spatial_division = NULL,
prodima = NULL,
inquiry = NULL,
institution = NULL,
publishing_year_start = NULL,
publishing_year_end = NULL,
order_nr = NULL,
limit = 1000,
article_model = 900030,
article_model_group = 900029,
return_raw = FALSE
)
language |
Language of the catalog: |
title |
Text to search in the titles. |
extended_search |
Text to search in the titles, BFS number and summaries. |
spatial_division |
Spatial division of the datasets: |
prodima |
Theme number(s) of the BFS, e.g. |
inquiry |
Inquiry (survey) id. |
institution |
Institution id. |
publishing_year_start, publishing_year_end |
First and last publishing year. |
order_nr |
BFS number, e.g. |
limit |
Maximum number of results (1000 by default). A message tells
you when the catalog has as many results as |
article_model, article_model_group |
Article type ids of the DAM API. The defaults select the "Data" (or "Tables") article type; you don't need to change them. |
return_raw |
If |
The English and Italian catalogs have fewer tables than the German and
French ones. Arguments accept several values, e.g.
prodima = c(900210, 900212).
A tibble with the columns:
Title of the table.
Language of the catalog.
Asset number, to use in bfs_download_asset().
Publication date.
BFS number.
Returns NULL if there is no internet connection.
bfs_download_asset(), bfs_get_catalog_data()
tables <- bfs_get_catalog_tables(language = "en", extended_search = "students")
tables
# download the first table
bfs_download_asset(
number_asset = tables$number_asset[1],
destfile = file.path(tempdir(), "table.xlsx")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.