Ivar Herfindal wrote:
> Hello.
>
> I have a problem using sort() in windows 2000 and windows NT 4.0,
> running R 1.8.0 on both. I want to sort a vector of characters names,
> where I have used "Scandinavian" letters, like '?',
'?', and '?' (for
> those who cannot display these letters this question seems rather
> meaningless, i guess). Windows 2000 sorts the vector like I am used to
> from other software, with '?' as the last letter in the alphabet,
while
> windows NT has "?" just after "A", and "?"
following "O".
>
> Is there a way to solve this problem (other than replace the
> Scandinavian letters)?
>
> A short example:
> sort(c('a','p','?'))
> # on windows 2000:
> [1] "a" "p" "?"
>
> # on windows NT
> [1] "a" "?" "p"
>
> Thanks in advance
?sort tells us:
"The sort order for character vectors will depend on the collating
sequence of the locale in use: see Comparison."
and ?Comparison points you to ?locales which gives an example:
Sys.setlocale("LC_COLLATE", "C") # turn off
locale-specific sorting
Uwe Ligges
> Ivar Herfindal
>
> On windows 2000:
>
>> version
>
> _ platform i386-pc-mingw32
> arch i386 os mingw32 system i386, mingw32
> status major 1 minor 8.0
> year 2003 month 10 day 08
> language R
>
>>
>
> On windows NT:
>
>> version
>
> _ platform i386-pc-mingw32
> arch i386 os mingw32 system i386, mingw32
> status major 1 minor 8.0
> year 2003 month 10 day 08
> language R
>
>>
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help