
Convert location codes to ISO 3166-1 alpha-3 country codes
Source:R/location_code_to.R
location_code_to_iso3.RdReturns the ISO 3166-1 alpha-3 country code for each location code. csdata
carries Norwegian data only, so the implementation returns "nor" for every
element without inspecting its value. A code from another country, or a
string that is not a location code at all, also returns "nor".
Value
A character vector of "nor". It has the same length as x, or
as many elements as x has rows when x is a data.table.
See also
No vignette covers this function.
vignette("locations_norway", package = "csdata") tabulates the
location_code values returned by nor_locations_names().
Other location code converters:
location_code_to_granularity_geo()
Examples
csdata::location_code_to_iso3(c("nation_nor", "county_nor03", "municip_nor0301"))
#> [1] "nor" "nor" "nor"
# the input value is not inspected
csdata::location_code_to_iso3(c("county_nor03", "xyz"))
#> [1] "nor" "nor"
library(data.table)
dt <- data.table(location_code = c("nation_nor", "county_nor03"))
csdata::location_code_to_iso3(dt)
#> [1] "nor" "nor"