Dear All, Can 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
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
Spencer Graves
2003-Aug-21 14:53 UTC
[R] A logical comparison between two character strings in R
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