[R] Change state names to abbreviations in an irregular, list of names, abbreviations, null values, and foreign provinces

David Kikuchi dkikuchi at live.unc.edu
Tue Jan 17 19:53:49 CET 2012


Thanks!  Both solutions work well for the problem that I described, 
although I failed to mention that there are also pre-abbreviated names 
in the list that I'm working with, and the second solution returns NA's 
for these (but there are plenty of ways around this).  Sample data might 
be: State.Province <- c("Cusco", "TX", "unknown", "Texas", NA, "Louisiana")

David



More information about the R-help mailing list