Re: [R] Partial comparison in string vector

2007-08-21 Thread Vladimir Eremeev
Hi! 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

Re: [R] Partial comparison in string vector

2007-08-21 Thread Moshe Olshansky
Use grep(^e,x) if you are looking for the entries where e is the first character. --- Vladimir Eremeev [EMAIL PROTECTED] wrote: Hi! 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