[R] pattern search

Sean Liang SLiang at wyeth.com
Fri Oct 29 20:45:56 CEST 2004


Bert:

I thought about that but was a bit concerned with the number of strings
(10^4) in my vector. Each of these strings can have any number of a
given patterns. I will give it a test to see if this is computationally
efficient. 


Thanks.

>>> Berton Gunter <gunter.berton at gene.com> 10/29/2004 2:16:53 PM >>>
Use regexp() in a loop that deletes each successive occurrence of the
pattern via substring() and keeps count.

-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
 
"The business of the statistician is to catalyze the scientific
learning
process."  - George E. P. Box
 
 

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Sean Liang
> Sent: Friday, October 29, 2004 11:06 AM
> To: R-help at stat.math.ethz.ch 
> Subject: [R] pattern search
> 
> hi, I like to find a pattern within a giver sequence. There might be
> multiple occurences of the pattern. I like to know the number of
> occurences and the positions if possible. "grep" can tell me if a
> pattern exists but can't give me the information I need. Does anyone
> know any function that I can use or know how to do what I intend?.
> Thanks a lot.
> 
> Sean
> 
> ______________________________________________
> R-help at 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 
>




More information about the R-help mailing list