[R] sort charcters in W2K and NT

Ivar Herfindal Ivar.Herfindal at bio.ntnu.no
Fri Oct 17 10:54:17 CEST 2003


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

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
>




More information about the R-help mailing list