Closed jrspringman closed 2 years ago
The built-in code sets follow precisely the standards as defined by each code sets' primary maintainer. So for instance, the International Organization for Standardization does not include Kosovo/XKX in its ISO 3166-1 alpha-3 standard, therefore {countrycode} will not include that in its iso3c
origin/destination code set.
You can easily add custom codes for specific countries like this...
library(countrycode)
country_names <- c('Greece', 'United Kingdom', 'Kosovo', 'France')
countrycode(country_names,
origin = 'country.name',
destination = 'iso3c',
custom_match = c(`Kosovo` = 'XKX'))
#> [1] "GRC" "GBR" "XKX" "FRA"
also see #61
Thanks so much!
Is it possible to get the iso3 for Kosovo set to XKX? Not all countries recognize Kosovo's independence, but many datasets treat it as an independent country.
The string
Kosovo
returns the following warning and yieldsNA
values.Warning messages: 1: Problem while computing iso3 = countrycode::countrycode(country, "country.name", "iso3c"). ℹ Some values were not matched unambiguously: Kosovo