[R] simple q: returning a logical vector of substring matches

lindeman at bard.edu lindeman at bard.edu
Sat Jan 20 19:30:33 CET 2007

I'm a relative R novice, and sometimes the simple things trip me up.

Suppose I have

a <- c("apple", "pear")

and I want a logical vector of whether each of these strings contains  
"ear" (in this case, F T). What is the idiom?

Mark Lindeman

More information about the R-help mailing list