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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Sean Liang > Sent: Friday, October 29, 2004 11:06 AM > To: [EMAIL PROTECTED] > 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 > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > ______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html