RHELP-L Archives

Knowledge sharing for the statistical software R

RHELP-L@LISTSERV.FAO.ORG

Options: Use Classic View

Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Matthieu Stigler <[log in to unmask]>
Fri, 22 Jun 2012 10:14:06 +0200
text/plain (1289 bytes) , text/html (1863 bytes)
Dear R list

Just wanted to share with you the news about a package that helps 
converting from different country coding systems (iso2, iso3, fao, un...).

If you are working with country-level data, it happens often that the 
countries will be spelled differently, have different codes etc... With 
the package countrycode, conversion to your favourite code (fao?) is 
facilitated.

I made a quick demo on the intranet: 
http://intranet.fao.org/departments/cio/ciok/kisaf/kisaf_home/r_platform/country_codes_conversion/

which shows basically these example:

|install.packages("countrycode")
||library(countrycode)
||countrycode(sourcevar = "GAB", origin = "iso3c", destination = "fao")
||countrycode(sourcevar = c("Gabon", "India"), origin = "country.name",  destination = "fao")|


Note that even if this helps for many countries, it is unlikely that it 
will work for all, since the package does not include all possible 
countries or state boundaries (think holy sea, Gaza band, "old" 
countries such as USSR or Yougoslavia..).

Best

Matthieu

-- 
________________________________
Matthieu Stigler
Economist Consultant, ESS
Room: C-402, extension: 53 364


########################################################################

To unsubscribe from the RHELP-L list, click the following link:
https://listserv.fao.org/scripts/wa-fao.exe?SUBED1=RHELP-L


ATOM RSS1 RSS2