Why does "one" < 2 equal FALSE in R?

From help("<"):

If the two arguments are atomic vectors of different types, one is coerced to the type of the other, the (decreasing) order of precedence being character, complex, numeric, integer, logical and raw.

So in this case, the numeric is of lower precedence than the character. So 2 is coerced to the character "2". Comparison of strings in character vectors is lexicographic which, as I understand it, is alphabetic but locale-dependent.


It coerces 2 into a character, then it does an alphabetical comparison. And numeric characters are assumed to come before alphabetical ones

to get a general idea on the behavior try

'a'<'1'
'1'<'.'
'b'<'B'
'a'<'B'
'A'<'B'
'C'<'B'