regular_expressionsWe have run into this issue before: you have $latex n \geq 2$ datasets with $latex 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.