R/municipality.R
municipality_id_to_name.Rd
Given a vector of municipality IDs/codes, return a named vector
of names of municipalities or regions. Codes of municipalities and regions
follow
the Swedish standard for municipality codes. The codes extracted can be used
e.g. to pass as a parameter to get_values
. This function is the
inverse to municipality_name_to_id
.
municipality_id_to_name(munic_df, id, remove_na = FALSE)
A Kolada Municipality metadata table, as created by e.g.
get_municipality
.
ID ids of one or several municipalities. Allows repeats.
Should NA return values be removed?
A vector of Municipality names.
munic_df <- get_municipality()
municipality_id_to_name(munic_df, c("1280", "1281", "0180", "1280"))
#> 1280 1281 0180 1280
#> "Malmö" "Lund" "Stockholm" "Malmö"