On Tue, May 22, 2012 at 3:12 PM, Hui Du <hui...@dataventures.com> wrote: > > Thanks all. I am trying to cleaning up user-inputted zip code. Most of them > are pure numeric values but someone put characters in zipcode field, so I > have to treat that field as a string rather than number.
But a padded invalid zip code, is still an invalid zip code. So why not fix them first, then pad them? grepl() would be useful to identify which have non-numeric characters. Sarah -- Sarah Goslee http://www.functionaldiversity.org ______________________________________________ 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.