Last chance! 50% off unlimited learning
Sale ends in
This function is mainly a wrapper around the well-known countrycode function, with three exception that are particular to the European Union statistical nomenclature.
Treated valid, because NUTS uses EL instead of GR for Greece since 2010.
Treated valid, because NUTS uses UK instead of GB for the United Kingdom.
XK is used for Kosovo, because Eurostat uses this code, too.
All ISO-3166-1 country codes are validated, and also the three exceptions.
validate_nuts_countries(dat, geo_var = "geo")
A data frame with a 2-character geo variable to be validated
Defaults to "geo"
. The variable that contains the
2 character geo codes to be validated.
The original data frame extended with the column 'typology'
.
This column states 'country'
for valid country typology coding, or
appropriate label for invalid ISO-3166-alpha-2 and ISO-3166-alpha-3 codes.
Other validate functions:
validate_nuts_regions()
# NOT RUN {
{
my_dat <- data.frame (
geo = c("AL", "GR", "XK", "EL", "UK", "GB", "NLD", "ZZ" ),
values = runif(8)
)
## NLD is an ISO 3-character code and is not validated.
validate_nuts_countries(my_dat)
}
# }
Run the code above in your browser using DataLab