
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.
Currently all Norwegian location codes map to "nor".
Value
A character vector the same length as x (or with as many elements
as there are rows in x when x is a data.table), containing the
corresponding ISO 3166-1 alpha-3 country code (always "nor").
Examples
csdata::location_code_to_iso3(c("nation_nor", "county_nor03", "municip_nor0301"))
#> [1] "nor" "nor" "nor"
library(data.table)
dt <- data.table(location_code = c("nation_nor", "county_nor03"))
csdata::location_code_to_iso3(dt)
#> [1] "nor" "nor"