[R] grep for strings
jholtman at gmail.com
Sun Dec 5 04:32:53 CET 2010
> x <- "abcdefghijkl"
starting httpd help server ... done
> regexpr('cd', x)
On Sat, Dec 4, 2010 at 9:34 PM, Santosh Srinivas
<santosh.srinivas at gmail.com> wrote:
> 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 :().
>  "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.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Data Munger Guru
What is the problem that you are trying to solve?
More information about the R-help