Describe an SSB table and its dimensions
ssb_describe.RdReturns a compact summary of a table's structure: its title, when it was last updated, and a row for each dimension showing how many codes are available and what role the dimension plays. This is the recommended first call when working with a new table.
Arguments
- table_id
Character. The SSB table identifier, for example
"07459".- language
Character. Language for labels.
"no"(default) or"en".- cache
Logical. If
TRUE(the default), table metadata is stored in memory for the session so that repeated calls are fast.- refresh_metadata
Logical. If
TRUE, discard any cached metadata and fetch fresh information from SSB. Defaults toFALSE.
Details
The function returns a named list with two elements:
$tableA list with
table_id,table_label,updated(ISO timestamp), andfull_table_estimated_rows(the total number of cells if you were to download the whole table).$dimensionsA
data.framewith one row per dimension, containing the dimensionid, itslabel, itsrole, the number of available codes (n_codes), and a logical columnhas_unitsindicating whether unit metadata is available.
The role column classifies each dimension:
"time"The primary time dimension.
"geo"A geographic dimension such as municipality or county.
"contents"The measure dimension (what is being counted or measured).
"other"Any other classification variable.
See also
ssb_search() to find table identifiers.
ssb_codes() to list valid filter values for a dimension.
ssb_units() to inspect measurement units.
Examples
if (FALSE) { # \dontrun{
desc <- ssb_describe("07459")
# Print the table-level summary
desc$table
# View the dimension list — use the 'dimension' column as
# the names of filter arguments in get_ssb_data()
desc$dimensions
# Same table with English labels
ssb_describe("07459", language = "en")
} # }