Search SSB tables by keyword
ssb_search.RdSearches the SSB Statistikkbank table catalogue and returns a summary of matching tables. Use this as the starting point when you do not yet know the table identifier you need.
Usage
ssb_search(
query = NULL,
language = "no",
page = 1L,
page_size = 20L,
fetch_all = FALSE,
as_tibble = TRUE
)Arguments
- query
Optional character. A keyword to search on. The search matches table titles. Pass
NULL(the default) to list all available tables without filtering.- language
Character. Language for table titles and labels. Use
"no"for Norwegian (the default) or"en"for English.- page
Integer. Which page of results to return. Defaults to
1(the first page). SSB paginates search results; usefetch_all = TRUEif you want all pages at once.- page_size
Integer. Number of tables per page. Must be between 1 and 1000. Defaults to
20.- fetch_all
Logical. If
TRUE, all pages are fetched automatically and combined into a single result. Defaults toFALSE.- as_tibble
Logical. If
TRUE(the default), the result is returned as a tibble.
Value
A tibble (or data.frame when
as_tibble = FALSE) with one row per matching table.
Details
Each row in the result describes one table and contains the following columns:
idThe table identifier to pass to
get_ssb_data().labelThe full title of the table.
descriptionA short description (may be
NA).updatedDate and time the table was last updated.
first_period,last_periodThe earliest and latest time periods available.
categoryThematic category (e.g.
"befolkning").sourceThe SSB unit that publishes the table.
variablesComma-separated dimension names, excluding the measure dimension which is present in every table.
The result also carries four attributes describing the current page:
page_number, page_size, total_elements, and total_pages.
When fetch_all = TRUE the attributes reflect the last fetched page.
See also
ssb_describe() to inspect the dimensions of a specific table.
get_ssb_data() to download data from a table.