On Feb 26, 2010, at 3:02 PM, kayj wrote:
Hi , I have tried gsub(".*York(\\d+).*", "\\1", grep("New York", x, value = TRUE)) and outputs "P New York722AZ" "K New York20"
Strange: > x<-c("P Los Angeles44AZ", "P New York722AZ", "K New York20") > > gsub(".*York(\\d+).*", "\\1", grep("New York", x, value = TRUE)) [1] "722" "20"
but that is not what i want, I want the output to be 722,20
Aside from being a character vector without commas, it seemed pretty close.
David Winsemius, MD Heritage Laboratories West Hartford, CT ______________________________________________ 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.