Skip to contents

Get the list of the data available in the official DAM-API of the Swiss Federal Statistical Office asset catalog.

Usage

bfs_get_catalog_data(
  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 = 900033,
  article_model_group = 900029
)

Arguments

language

character The language of a BFS catalog, i.e. "de", "fr", "it" or "en".

title

character String to search in (sub/super)title

extended_search

character String for an extended search in (sub/super)title, orderNr, summary, shortSummary, shortTextGNP

spatial_division

BFS datasets by spatial division, choose between "Switzerland", "Cantons", "Districts", "Communes", "Other spatial divisions" or "International"

prodima

numeric Get only specific BFS themes using one or multiple prodima numbers

inquiry

character BFS datasets for an inquiry

institution

character BFS datasets for an institution

publishing_year_start

character BFS datasets for a publishing year start

publishing_year_end

character BFS datasets for a publishing year end

order_nr

character Filter by BFS Number (FSO number)

limit

integer limit of query results (1000 by default)

article_model

integer articleModel parameter query

article_model_group

integer articleModel parameter query

Value

A data frame. Returns NULL if no connection.

A tbl_df (a type of data frame; see tibble or dplyr packages). Returns NULL if no connection.

See also

bfs_get_data

title

A character column with the title of the BFS dataset

language

A character column with the language of the BFS dataset

publication_date

The published date of the BFS dataset in the data catalog

number_asset

The BFS asset number

url_px

A character column with the URL of the PX file

Examples

# \donttest{
bfs_get_catalog_data(language = "en", title = "students", prodima = c(900212))
#> # A tibble: 4 × 9
#>   title                   language number_asset publication_date order_nr url_px
#>   <chr>                   <chr>    <chr>        <date>           <chr>    <chr> 
#> 1 University of applied … en       31306033     2024-03-28       px-x-15… https…
#> 2 University of applied … en       31306029     2024-03-28       px-x-15… https…
#> 3 University students by… en       31305852     2024-03-28       px-x-15… https…
#> 4 University students by… en       31305854     2024-03-28       px-x-15… https…
#> # ℹ 3 more variables: language_available <list>, url_structure_json <chr>,
#> #   damId <int>
# }