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 83 forks source link

Not matching for Turkey's new official name #307

Closed hgoers closed 2 years ago

hgoers commented 2 years ago

Hello all,

Thank you so much for countrycode. I use it almost every day to support my work and research.

I noticed a small issue resulting from the recent official name change for Turkey. The current regex does not pick up this new name: Türkiye.

Reprex:

countrycode::countrycode("Türkiye", "country.name", "country.name")

Warning thrown:

Warning message:
In countrycode_convert(sourcevar = sourcevar, origin = origin, destination = dest,  :
  Some values were not matched unambiguously: Türkiye

I was able to convert it with the rather crude turkey|türkiye|turkiye.

Thanks!

vincentarelbundock commented 2 years ago

The default regexes are designed to pick up English names. You could try then countryname() which tries to do more clever stuff

NilsEnevoldsen commented 2 years ago

I agree with the issue. Türkiye is going to be seen in English more often now.

hgoers commented 2 years ago

My understanding is that Türkiye is to be used in English and French (I am not sure about other languages). It would be really useful if countrycode::countrycode could either convert Turkey to Türkiye (and Turquie to Türkiye) to reflect this new official name, or if the country.name.X.regex picked up Türkiye and converted it to Turkey (Turquie).

vincentarelbundock commented 2 years ago

Ah thanks for the clarification! I agree we should make that change.

I'm on vacation now but will be happy to make the change when I return in a few weeks if no one has gotten to it yet.

Thanks for the report!

hgoers commented 2 years ago

Thanks so much for a fantastic package!