mhoward at micron.com wrote:
> Does R have a comparison operator similar to the Like function, for example:
>
> a<-"Is a Fish"
> b<-"Fish"
>
> if(b in a){c<-TRUE}
>
How about ?regexpr:
R> a="is a fish"
R> b="fish"
R> regexpr(b,a)
[1] 6
attr(,"match.length")
[1] 4
R> regexpr(b,a)>0
[1] TRUE
R> b="Fish"
R> regexpr(b,a)>0
[1] FALSE
Note
Regards,
Sundar