[R] Comparison Operator

Spencer Graves spencer.graves at pdf.com
Fri May 30 01:24:48 CEST 2003


Have you considered "regexpr"?

 > a<-"Is a Fish"
 > b<-"Fish"
 > regexpr(b, a)
[1] 6
attr(,"match.length")
[1] 4

hth.  spencer graves

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}
> 
> Michael R Howard
> Micron Technology Inc. Boise ID.
> Fab C Engineering Software (FCES)
> Software Engineer
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list