vincentarelbundock / countrycode

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

Côte d’Ivoire its not translated #211

Closed jas1 closed 4 years ago

jas1 commented 5 years ago

value: Côte d’Ivoire filter: iso 2 code.

where i got the iso 2 code: https://en.wikipedia.org/wiki/Ivory_Coast

reprex:

library(countrycode)
library(tidyverse)
#> Warning: package 'tidyverse' was built under R version 3.5.3
#> Warning: package 'ggplot2' was built under R version 3.5.3
#> Warning: package 'tibble' was built under R version 3.5.3
#> Warning: package 'tidyr' was built under R version 3.5.3
#> Warning: package 'readr' was built under R version 3.5.2
#> Warning: package 'purrr' was built under R version 3.5.3
#> Warning: package 'dplyr' was built under R version 3.5.3
#> Warning: package 'stringr' was built under R version 3.5.2
#> Warning: package 'forcats' was built under R version 3.5.3
countrycode::codelist %>% 
  select(cldr.short.en,cldr.short.es,iso2c,iso3c,un.name.en,country.name.en) %>% 
  filter(iso2c=="CI")
#>   cldr.short.en cldr.short.es iso2c iso3c    un.name.en country.name.en
#> 1 Côte d’Ivoire Côte d’Ivoire    CI   CIV Côte D'Ivoire   Côte d’Ivoire

should say:

english value: Ivory Coast spanish value: Costa de Marfil

vincentarelbundock commented 5 years ago

"cldr" is a unicode initiative to offer standardized country names. The official cldr name for that country is "Côte d’Ivoire". Obviously, that is one of the more contentious choices, since the organization discusses this specific case on their website:

http://cldr.unicode.org/translation/country-names

For what it's worth, the ISO org also uses the French version, even in their English codes.

https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes

Currently, the "default" country names in countrycode are "cldr". I think that's defensible, but I'm open to arguments.

If you want "Ivory Coast", you could use one of the other country name schemes supported by countrycode. See:

library(tidyverse)
countrycode::codelist %>%    
    filter(iso2c == 'CI') %>%    
    select(matches('name'), -matches('cldr'))    
cjyetman commented 4 years ago

closing since there's been no response and a suitable answer was given

jas1 commented 4 years ago

Thanks for the answers. :)