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 > 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. > > ______________________________________________ > R-help@stat.math.ethz.ch 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. > ______________________________________________ R-help@stat.math.ethz.ch 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.