[R] (no subject)

graham lawrence forporphyry at hotmail.com
Fri Jan 17 00:31:03 CET 2003



Dear R-help,

Why does the second grep reject when the first grep accepts?
Why does regexpr accept what grep rejects?

>eqtn
[1] "(1.2*A%*%B)/2"
>if(grep("A\\%\\*\\%B",eqtn)==1)erind<-1
>if(grep("A\\%\\*\\%A",eqtn)==1)erind<-1
Error in if (grep("A\\%\\*\\%A", eqtn) == 1) erind <- 1 :
        missing value where logical needed
>if(regexpr("A\\%\\*\\%A",eqtn)==1)erind<-1
>

TIA

graham lawrence




More information about the R-help mailing list