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

2010-05-30 Thread Steven Lembark
On Fri, 28 May 2010 01:17:49 -0700 (PDT) carslaw david.cars...@kcl.ac.uk wrote: [4] HGV-D-Euro-III HGV-D-Euro-IV EGR HGV-D-Euro-IV SCR [4] HGV-D-Euro-III HGV-D-Euro-IV EGR HGV-D-Euro-IV SCR [7] HGV-D-Euro-IV SCRb HGV-D-Euro-V EGR HGV-D-Euro-VI [7] HGV-D-Euro-IV SCRb

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

2010-05-28 Thread carslaw
Dear R users, I'm a bit perplexed with the effect sort has here, as it is different on Windows vs. linux. It makes my factor levels and subsequent plots different on the two systems. Given: types - c(PC-D-Euro-0, PC-D-Euro-1, PC-D-Euro-2, PC-D-Euro-3, PC-D-Euro-4, PC-D-Euro-5, PC-D-Euro-6,

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

2010-05-28 Thread Ted Harding
On 28-May-10 08:17:49, carslaw wrote: Dear R users, I'm a bit perplexed with the effect sort has here, as it is different on Windows vs. linux. It makes my factor levels and subsequent plots different on the two systems. Given: types - c(PC-D-Euro-0, PC-D-Euro-1, PC-D-Euro-2,

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

2010-05-28 Thread Ted Harding
In my response cited below: On 28-May-10 09:55:36, Ted Harding wrote: I suspect the result (in Linux, I can't test this on Windows) may be related to the following phenomenon: sort(c(AB CD,ABCD)) # [1] ABCD AB CD sort(c(AB CD,ABCD )) # [1] AB CD ABCD I.e. ABCD precedes AB CD

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

2010-05-28 Thread carslaw
Thanks Ted, Indeed, there is a difference between the systems on your much-simplified example (thanks). So, linux: sort(c(AB CD,ABCD)) [1] ABCD AB CD Windows: sort(c(AB CD,ABCD)) [1] AB CD ABCD Regards, David -- View this message in context:

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

2010-05-28 Thread Duncan Murdoch
carslaw wrote: Dear R users, I'm a bit perplexed with the effect sort has here, as it is different on Windows vs. linux. It makes my factor levels and subsequent plots different on the two systems. You are using different collation orders. On Linux, your sessionInfo shows en_GB.utf8

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

2010-05-28 Thread Joris Meys
Pretty obvious: You use different locales (collate). What happens if you use the same on both machines? Cheers Joris On Fri, May 28, 2010 at 10:17 AM, carslaw david.cars...@kcl.ac.uk wrote: Dear R users, I'm a bit perplexed with the effect sort has here, as it is different on ... the

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

2010-05-28 Thread Ted Harding
It would seem that there is indeed a locale effect. Revisiting the examples I used on Linux in a previous post, at which time I was using the default LC_COLLATE=en_GB.UTF-8, I changed this to C. Both the C and the en_GB.UTF-8 are indicated (the latter copied from my previous post):

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

2010-05-28 Thread Ted Harding
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).

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

2010-05-28 Thread Duncan Murdoch
On 28/05/2010 9:24 AM, (Ted Harding) wrote: 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, ...

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

2010-05-28 Thread Ted Harding
On 28-May-10 14:37:39, Duncan Murdoch wrote: On 28/05/2010 9:24 AM, (Ted Harding) wrote: 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

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

2010-05-28 Thread Daniel Nordlund
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ted Harding Sent: Friday, May 28, 2010 1:15 PM To: r-help@r-project.org Cc: carslaw Subject: Re: [R] difference in sort order linux/Windows (R.2.11.0) On 28-May-10 14:37:39

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

2010-05-28 Thread Ted Harding
Linux problem solved! (For me at any rate). Thanks to some hints from my Linux contacts it transpires that the problem with sort EOT ABCD A CD EOT # ABCD # A CD sort EOT ADCD A CD EOT # A CD # ADCD arises because, by default, the is ignored in sorting. Therefore in the first case it sorted