Dear all
In the grep command below, is there a way to identify only "age" and
not "age2"? Thanks.

> x<-c("abc","def","rst","xyz","age","age2")
> x
[1] "abc"  "def"  "rst"  "xyz"  "age"  "age2"
> grep("age2",x)
[1] 6
> grep("age",x) # I need to grab "age" only, not "age2"
[1] 5 6

Also, I post message to r-help@r-project.org and that's subject to
approval by the list moderator. Am I sending it to the wrong address?

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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