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"<"10"[1] TRUE> " 2"<"10"[1] TRUE On RedHat " "<"1" [1] TRUE> " 1" < "10"[1] TRUE> " 2" < "10"[1] FALSE Similarly, on Slackware, Windows and SPlus>"2"<"-"[1] FALSE> "23"<"-3"[1] FALSE On RedHat> "2"<"-"[1] FALSE> "23"<"-3"[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:> 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.[...] And what does it say in ?Comparison it does?> Is this a RedHat problem or an R problem?Another possibility you have overlooked is a Karen Schlauch problem -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
# aldus kschlauc@vt.edu :> 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.> Is this a RedHat problem or an R problem?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 -- Peter Kleiweg http://www.let.rug.nl/~kleiweg/
kschlauc@vt.edu writes:> I am running R version 1.7.1 on 3 different operating systems: > Linux RedHat, Linux Slackware, and Windows 2000.> > " 2" < "10" > [1] FALSE > > "23"<"-3" > [1] TRUE > > > Is this a RedHat problem or an R problem?not R I think, but which RedHat?? I get> "23"<"-3"[1] FALSE> " 2" < "10"[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 -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907