From hadley at rice.edu  Thu Dec  8 14:30:36 2011
From: hadley at rice.edu (Hadley Wickham)
Date: Thu, 8 Dec 2011 13:30:36 +0000
Subject: [Rd] bug in rank(), order(), is.unsorted() on character vector
In-Reply-To: <4EE089EE.2060903@fhcrc.org>
References: <CB050CA6.25561%proebuck@mdanderson.org>
	<4EE089EE.2060903@fhcrc.org>
Message-ID: <CABdHhvHnkmZ5mSAWRfmcEAz59YToACB8K+qo_uQb9=g89UE7wQ@mail.gmail.com>

> 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/



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