Converting and Standardizing Country Names/Codes in R

regular_expressionsWe have run into this issue before: you have n \geq 2 datasets with 1 < k \leq n different coding schemes for the cross-sectional unit. You need to get them all standardized so you can merge the data and increase the measurement error  control for a reviewer’s favorite variable run some models.

Last week I was about to spend some time merging alphanumeric ISO codes with their COW counterparts, when I ran across the new countrycode package in R.* The package uses regular expressions to convert between the following supported formats:

  • Correlates of War character
  • CoW-numeric
  • ISO3-character,
  • ISO3-numeric
  • ISO2-character
  • IMF numeric
  • FIPS 10-4
  • FAO numeric
  • United Nations numeric
  • World Bank character
  • official English short country names (ISO)
  • continent
  • region

The author is Vincent Arel-Bundock, a doctoral student in comparative politics at Michigan. Thanks Vincent!


* New here meaning I didn’t know about it before and its documentation is dated Jan. 20, 2013.

2 thoughts on “Converting and Standardizing Country Names/Codes in R

  1. Struggling to get your car paid off? Are you mad about the last
    deal you got? Perhaps you’re looking for an automobile now, and you’re not sure what
    to do differently. You’re in the same boat with many other people. Keep reading to find out information regarding what to do next time you enter a dealership.

Comments are closed.