vincentarelbundock / countrycode

R package: Convert country names and country codes. Assigns region descriptors.
https://vincentarelbundock.github.io/countrycode
GNU General Public License v3.0
342 stars 84 forks source link

Turkey -> Turkiye #310

Closed BPJandree closed 2 years ago

BPJandree commented 2 years ago

Dear Vincent,

I'm less familiar with the inner workings of this package but assume it will similarly be affected by the Turkey -> Turkiye name change.

I know some applications use countrycode to make calls via WDI (or take WDI data and pass it through countrycode) which will either way likely break.

My sense it's a simple update of the countryname_dict.rda but I'm not sure how different languages have taken up the name change and what formally would be the best approach. There could also be backward compatibility issues associated with simply swapping the name.

Perhaps for user experience adding an exception somewhere in the code so that both

countrycode("Turkey", origin="country.name", destination = "iso3c")

and

countrycode("Turkiye", origin="country.name", destination = "iso3c")

will work. Right now the second does not:


> countrycode("Turkey", origin="country.name", destination = "iso3c")
[1] "TUR"
> countrycode("Turkiye", origin="country.name", destination = "iso3c")
[1] NA
Warning message:
In countrycode_convert(sourcevar = sourcevar, origin = origin, destination = dest,  :
  Some values were not matched unambiguously: Turkiye
```vim

Best,
Bo
vincentarelbundock commented 2 years ago

Thanks Bo,

This has already been fixed in the development version which can install from Github. The improved regular expression will be part of the next CRAN release, in the next weeks.

BPJandree commented 2 years ago

Great! I'll close then, Best,