The function identifies the sub-national geographical identifiers from known typologies and returns the ISO 3166-1 alpha-2 country codes.

get_country_code(geo, typology = "NUTS")

Arguments

geo

A character variable with geo codes.

typology

Currently the following typologies are supported: "NUTS1", "NUTS2", "NUTS3" or "NUTS" for any of the NUTS typologies. The technical typology "NUTS0" can be used to translate Eurostat country codes to ISO 3166-1 alpha-2 country codes.

Value

The ISO 3166-1 alpha-2 codes of the countries as a character vector.

See also

Other recode functions: recode_nuts()

Examples

{
get_country_code (c("EL", "GR", "DED", "HU102"))
}
#> [1] "GR" "GR" "DE" "HU"