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

Convert to nationality #287

Closed luispfonseca closed 2 years ago

luispfonseca commented 3 years ago

Would there be interest in a function to convert country name to nationality?

Not advocating for this particular source here, but the CIA's World Factbook does seem to have information on the name of nationalities. See https://www.cia.gov/the-world-factbook/field/nationality

vincentarelbundock commented 3 years ago

Oh, this is neat!

Yeah, I think noun and adjective could definitely be added.

Ideally we would scrape this straight from the source in a file like this one https://github.com/vincentarelbundock/countrycode/blob/main/dictionary/get_eurostat.R

NilsEnevoldsen commented 3 years ago

I'm skeptical that demonyms should be in scope. Do we also add capitals? Currencies? Time zones?

What is the use-case for this feature?

If we add demonyms, would they be destination-only?

What do we do with countries with multiple demonyms, such as France ("Frenchman(men), Frenchwoman(women)") or Wallis and Futuna ("Wallisian(s), Futunan(s), or Wallis and Futuna Islanders")?

vincentarelbundock commented 3 years ago

Yes, if this were to be implemented, it would likely be destination-only.

Not sure we would need to pick one when there are multiple competing demonyms: just respect the original source (e.g., CIA factbook).

I think it's cute and reacted positively, but perhaps you are right that the use-cases are limited. And maybe we should keep a tight lid on the scope. After all, if people have a table with two columns country, demonym, they can easily use countrycode to create a cross-walk.

Maybe this is a candidate for a custom_dict entry like the ones we saved here:

https://github.com/vincentarelbundock/countrycode/tree/main/data/custom_dictionaries

cjyetman commented 3 years ago

Sounds like the perfect thing for a custom dictionary to me.