[R] grep for strings

Santosh Srinivas santosh.srinivas at gmail.com
Sun Dec 5 03:34:08 CET 2010


I am trying to find the function where I can search for a pattern in a
text string (I thought I could use grep for this but no :().

> x
[1] "abcdefghijkl"

I want to find the positions (i.e. equivalent of nchar) for "cd" and
in case there are multiple hits .. then the results as a array

Thank you.



More information about the R-help mailing list