powered by
Extracts aggregation and value set codelists from a PXWEB API v2 metadata object. Use the returned id values with pxweb_aggregation or pxweb_valueset.
id
pxweb_aggregation
pxweb_valueset
pxweb_codelists(x, variable = NULL, type = NULL)
A data.frame with columns variable_code, variable_text, id, label, type, and href.
data.frame
variable_code
variable_text
label
type
href
a pxweb_metadata object created from PXWEB API v2 metadata, or a raw PXWEB API v2 metadata list.
pxweb_metadata
optional variable code or label to filter on.
optional codelist type to filter on, for example "Aggregation" or "Valueset".
"Aggregation"
"Valueset"
if (FALSE) { meta <- pxweb_get("https://statistikdatabasen.scb.se/api/v2/tables/TAB5974/metadata?lang=sv") pxweb_codelists(meta, variable = "Alder") }
Run the code above in your browser using DataLab