[R] A logical comparison between two character strings in R

Spencer Graves spencer.graves at pdf.com
Thu Aug 21 16:53:23 CEST 2003


Did you check any documentation on R, e.g., help(Comparison) or 
"www.r-project.org" -> Manuals -> "An Introdunction to R"?  In Section 
2.4 on "Logical vectors", I find, "The logical operators are <, <=, >, 
 >=, == for exact equality ... ."  Consider the following:

 > "A-1-B" == "cc-10000"
[1] FALSE

hope this helps.  spencer graves



Lun Li wrote:
> Dear All,
> 
> Does anyone know how to compare two character strings in R?  For eample, how 
> to compare "A-1-B" with "cc-10000" in logical ?
> 
> Cheers,
> 
> 
> Lun Li
> 
> ______________________________________________
> 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