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

From: Niklaus Kuehnis <kuehnik_0505_at_gmx-topmail.de>
Date: Wed, 25 May 2011 12:06:37 +0200


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



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 25 May 2011 - 14:37:13 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 25 May 2011 - 18:40:10 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive