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

Witold E Wolski wewolski at gmail.com
Tue Jul 8 14:14:48 CEST 2014


>From my reading of
http://r.789695.n4.nabble.com/internal-string-comparison-Scollate-td4687584.html
they have good arguments to ask for Scollate whatever it is in the R public API.


And from my point of view R would benefit from a tight integration of
data.table.
Without data.table R is very impractical to use, with data which is
avaiable today.

On 6 July 2014 14:15, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
> 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
>>
>>
>>
>



-- 
Witold Eryk Wolski



More information about the R-help mailing list