On 07/01/2010 07:56 AM, Cable, Samuel B Civ USAF AFMC AFRL/RVBXI wrote:
Okay, here is a reproducible example of a possible solution (actually
it
probably does not do what you want but it's a start for discussion.
Note it is actual code and data which is what is needed.
=======================================================
str1<- "abc"
str2<- "abcd"
str3<- "efgh"

grep(str1, str2)
grep(str1,str3)
=======================================================
So what's wrong with:

pmatch(str1,str2,nomatch=0)
[1] 1
pmatch(str1,str3,nomatch=0)
[1] 0

Jim

______________________________________________
R-help@r-project.org 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.

Reply via email to