[Rd] bug in rank(), order(), is.unsorted() on character vector

Hadley Wickham hadley at rice.edu
Thu Dec 8 14:30:36 CET 2011


> Actually this is the situation I was facing when I did my first post:
> I have a function that downloads a list of sequences from the Ensembl
> FTP server, sorts them by name, and returns them to the user. I have
> a test for that function and the test was working for me when I was
> doing
>
>  tools::testInstalledPackage("MyPackage", "types="tests")
>
> but it was failing when I was doing 'R CMD check'. It seems that
> the latter alters LC_COLLATE before running the tests (maybe to
> LC_COLLATE=C) but not the former. I fixed this by enforcing
> LC_COLLATE=C inside my function.
>
> A naive question: wouldn't everything be simpler if LC_COLLATE=C
> was the default for everybody?

Or if at least LC_COLLATE=C was the default for everyone when running
R CMD check.

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/



More information about the R-devel mailing list