[R] Partial comparison in string vector

Vladimir Eremeev wl2776 at gmail.com
Tue Aug 21 11:46:37 CEST 2007


seq(along=x) %in% grep("e",x)

Steve Powell-4 wrote:
> I have a vector of strings
> x=c("w","ex","ee")
> And I want to get a logical vector showing the positions where my search
> string "e" matches the elements partially, i.e. is at least the left-hand
> part of the target strings, i.e. I want to get a vector FALSE TRUE TRUE.

View this message in context: http://www.nabble.com/Partial-comparison-in-string-vector-tf4304145.html#a12251593
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list