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

(Ted Harding) Ted.Harding at manchester.ac.uk
Fri May 28 15:24:20 CEST 2010


An experiment:

  sort(c("AACD","A CD"))
  #  [1] "AACD" "A CD"

  sort(c("ABCD","A CD"))
  #  [1] "ABCD" "A CD"

  sort(c("ACCD","A CD"))
  #  [1] "ACCD" "A CD"

  sort(c("ADCD","A CD"))
  #  [1] "A CD" "ADCD"

  sort(c("AECD","A CD"))
  #  [1] "A CD" "AECD"
  ## (with results for "AFCD", ... "AZCD" similar to the last two).

  LC_COLLATE=en_GB.UTF-8

(R version 2.11.0 (2010-04-22) on Linux).

So this behaves, in en_GB.UTF-8, as though " " (SPACE) is between
"C" and "D".

This is nuts!!!

Curable if I set (e.g.) LC_LOCALE="C" on startup. But what else
might break if I do so?

Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 28-May-10                                       Time: 14:24:08
------------------------------ XFMail ------------------------------



More information about the R-help mailing list