[R] Does order() behave differently on different platforms?

Raja Surapanani raja.surapanani at fmr.com
Fri Aug 15 19:11:34 CEST 2003


Hello, 

I am running R 1.7.1 on two platforms and it seems to me that order() behaves 
differently on them. I noticed this when a test case passed in linux but 
failed on solaris. This is the behavior on the solaris platform: 

R.Version()
$platform
[1] "sparc-sun-solaris2.8"

$arch

[1] "sparc"
$os
[1] "solaris2.8"

$system
[1] "sparc, solaris2.8"

$status
[1] ""

$major
[1] "1"

$minor
[1] "7.1"

$year
[1] "2003"

$month
[1] "06"

$day
[1] "16"

$language
[1] "R"

> x <- c("a", "b", "c", "(d")
> sort(x)
[1] "(d" "a"  "b"  "c" 

This is the behavior on the linux platform: 

> R.Version()
$platform
[1] "i686-pc-linux-gnu"

$arch
[1] "i686"

$os
[1] "linux-gnu"

$system
[1] "i686, linux-gnu"

$status
[1] ""

$major
[1] "1"

$minor
[1] "7.1"

$year
[1] "2003"

$month
[1] "06"

$day
[1] "16"

$language
[1] "R"

 x <- c("a", "b", "c", "(d")
> sort(x)
[1] "a"  "b"  "c"  "(d"

Am I missing something here or is there really a difference in the way order() 
works on different platforms? Thanks for your help. 

Regards, 
Raja




More information about the R-help mailing list