Inspect the members of an SSB codelist
ssb_codelist_details.RdDownloads the full definition of a single codelist — the group codes
it defines and which underlying member codes each group contains.
Use this to understand exactly how a codelist maps individual codes
to higher-level groups before using it in get_ssb_data().
Arguments
- codelist_id
Character. The codelist identifier, for example
"agg_KommSummer". Find available identifiers withssb_codelists().- language
Character. Language for labels.
"no"(default) or"en".- as_tibble
Logical. If
TRUE(the default), the$valueselement of the returned list is a tibble.
Value
A named list with two elements:
$codelistA list with metadata about the codelist:
id,label,type(e.g."Aggregation"),language,elimination(logical), andelimination_value_code.$valuesA
data.frameor tibble with one row per group code, containingcode(the group code),label(the group name),mapped_values(a comma-separated string of the member codes that belong to this group), andmapped_count(how many members the group contains).
Details
A codelist groups individual codes (for example, municipality codes) into aggregate units (for example, historical municipality boundaries or counties). This function lets you inspect those groupings directly.
See also
ssb_codelists() to list which codelists are available for a table.
ssb_expand_codelist_mapping() to join the member codes back onto
a data frame you have already downloaded.