Skip to content

alpha-numeric order bug (PR#3996)

4 messages · kschlauc@vt.edu, Brian Ripley, Peter Kleiweg +1 more

#
I am running R version 1.7.1 on 3 different operating systems:
Linux RedHat, Linux Slackware, and Windows 2000.

R is ordering alpha-numeric character strings in different ways, dependent
on the operating system. R orders strings exactly the same on Slackware and 
Windows,
and this ordering corresponds to SPlus. It's the RedHat that is creating the 
problem.

On Slackware, Windows, and SPlus:
 " "<"1"
[1] TRUE
[1] TRUE
[1] TRUE

On RedHat
 " "<"1"
[1] TRUE
[1] TRUE
[1] FALSE


Similarly, on Slackware, Windows and SPlus
[1] FALSE
[1] FALSE

On RedHat
[1] FALSE
[1] TRUE


Is this a RedHat problem or an R problem?

Thanks,
Karen Schlauch
#
Oh, please don't report your misunderstandings as bugs.  Do at least read 
the help page first!

Incidentally, the version of `SPlus' (sic) matters critically here.  On my
RedHat system " 2" < "10" is TRUE, but then I am not in your locale.
On Wed, 27 Aug 2003 kschlauc@vt.edu wrote:

            
[...]

And what does it say in ?Comparison it does?
Another possibility you have overlooked is a Karen Schlauch problem
#
# aldus kschlauc@vt.edu :
The sort order depends on environment variables. Try this:

    Sys.setlocale(category = "LC_ALL", locale = "POSIX")
    " 2" < "10"

This is explained in R. See:

    ?"<"
    ?locales
#
kschlauc@vt.edu writes:
not R I think, but which RedHat?? I get
[1] FALSE
[1] TRUE

on RH8.0 with

$ locale
LANG=C
LC_CTYPE=da_DK
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=