[R] sort order of a character sequence is different on windose and linux (linux result)

Duncan Murdoch murdoch.duncan at gmail.com
Sun Jul 6 14:15:12 CEST 2014


On 06/07/2014, 7:56 AM, Witold E Wolski wrote:
> This is the info I got from the data.table developers... Seems that
> they did have tried to find a more elegant solution solution.:

>From my reading of the response below, data.table doesn't use R's sort()
function to do their sorting.  You should use whatever sort function
they use if you want to match their sort order.

Duncan Murdoch

> 
> 
> data.table used to support this until 1.8.6. But since Scollate became
> not a part of authorised R-API (IIUC) anymore at some point,
> data.table only supports sort/order under the C-locale.
> 
> data.table's ordering/sorting is over 10-20x faster than base's and
> the only way right now (IIUC) to sort by locale is to use base's
> sort/order.
> 
> This post may give some more insight.
> http://r.789695.n4.nabble.com/internal-string-comparison-Scollate-td4687584.html
> 
> In summary, we support only C-locale.
> 
> 
> On 6 July 2014 13:33, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
>> On 06/07/2014, 7:19 AM, Witold E Wolski wrote:
>>> It seems that the package I am developing depends on the locale "C"
>>> because of interactions with other packages (data.table).
>>>
>>> So I would like to set the locale to "C" as soon as the package is loaded.
>>> Where can I do it .. I could of course set it in every function in my
>>> package but...
>>>
>>
>> As the help page says, you can't do it reliably on all platforms, and
>> you really shouldn't even try:  that will affect other things that the
>> user does.
>>
>> You will need to find another solution to your problem.
>>
>> Duncan Murdoch
> 
> 
>



More information about the R-help mailing list