[R] Sorting strings

Petr Savicky savicky at cs.cas.cz
Mon Feb 20 17:16:28 CET 2012


On Mon, Feb 20, 2012 at 04:56:21PM +0100, Petr Savicky wrote:
> On Mon, Feb 20, 2012 at 05:55:30AM -0800, statquant2 wrote:
> > I did, but this does not give the answer to my question...
> > Anybody knows how to tweack the behaviour of sort or how to do ?
> 
> Hi.
> 
> Try this
> 
>   Sys.setlocale("LC_COLLATE", "C") 
> 
> 
> This comes from ?locale and reads there

This is not in ?locale, but in ?locales

>      Sys.setlocale("LC_COLLATE", "C")   # turn off locale-specific sorting,
>                                         #  usually

This in the example section at the end.

Try also to see

  Sys.getlocale()

Relevant can also be LC_CTYPE

  Sys.setlocale("LC_CTYPE", "C")

Hope this helps.

Petr Savicky.



More information about the R-help mailing list