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

Frequently requested features #314

Open vincentarelbundock opened 1 year ago

vincentarelbundock commented 1 year ago

Support for regions, subnational entities, and other non-countries.

Many-to-One mapping

Some countries have multiple codes. For example, in cowc, Germany could be 255 or 260, depending on the time period we are looking at. Currently, countrycode works with a strict one-to-one mapping of codes to countries. Therefore, countrycode() can only recognize one of the codes -- typically the latest one.

The recommended approach is to use the countrycode_panel and to "left-merge" your country-year data directly there.

The countrycode maintainers are interested in implementing a more robust infrastructure for many-to-one mapping. If you have ideas for implementation and/or energy to submit code, please contribute to this thread: https://github.com/vincentarelbundock/countrycode/issues/186