[R] What does "smaller than" comparison do on strings?

Niklaus Kuehnis kuehnik_0505 at gmx-topmail.de
Wed May 25 12:06:37 CEST 2011


What's the logic behind the following, and where can I find any 
documentation about it? In particular, why are 2:9 - as characters - not 
regarded as being smaller than 10?

# R-Code:
a <- as.character(1:12)

a < 10
#  [1]  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE 
FALSE

Thanks in advance!

Niklaus



More information about the R-help mailing list