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

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to