[R] sorting character vectors

Peter Dalgaard p.dalgaard at biostat.ku.dk
Thu Aug 19 15:21:06 CEST 2004

andreas.krause at pharma.novartis.com writes:

> Thank you very much to Brian Ripley, Roger Peng, and Andy Liaw. Everyone 
> pointed out the same solution.
> Setting
> did it. This default setting is indeed odd to me.

It's odd to everyone, except perhaps to the POSIX locale mafia... Once
upon a time all dotfile sorted to the top of but nowadays "LANG=da_DK
ls -a | less" gives you


Oddly enough da_DK does sort names with a leading space before
characters, whereas de_DE does not.

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907

More information about the R-help mailing list