Skip to content
Prev 222372 / 398500 Next

difference in sort order linux/Windows (R.2.11.0)

carslaw wrote:
You are using different collation orders.  On Linux, your sessionInfo shows

en_GB.utf8   

while Windows shows

English_United Kingdom.1252


so you should be prepared for differences.  That said, it certainly 
looks as though the string comparison is wrong on Linux.  Using Ted 
Harding's examples, I get these results:

 > "AB CD" > "ABCD"
[1] FALSE
 > "AB CD" > "ABCD "
[1] FALSE

on Windows in the English_Canada.1252 locale and on Linux in the C 
locale.  However,  when I use the locale that's default on our system, 
en_US.UTF-8, I get

 > "AB CD" > "ABCD"
[1] TRUE
 > "AB CD" > "ABCD "
[1] FALSE

as Ted did, and that certainly looks wrong.

Duncan Murdoch