klutometis/roxygen — Issue #66: Set a canonical sort order for generating NAMESPACE file
Author: BrianDiggs
Created: 2011-12-09 18:36:29+00:00
State: open

Depending on platform, and `LC_COLLATE`, the order of exports written to `NAMESPACE` can change. For a concrete example, in ggplot2, on Windows 7 64 bit (`LC_COLLATE=English_United States.1252`), I get the order aes, aes_all, aes_string. The file as checked in has aes_all, aes_string, aes. One is not more correct than the other, but after running document() on the package, my `NAMESPACE` file is marked as changed by git and I have to make sure it does not get included in a commit since there is no functional change there.

This could be solved by locally setting a collation order. See also a recent thread on r-devel "bug in rank(), order(), is.unsorted() on character vector" http://thread.gmane.org/gmane.comp.lang.r.devel/29677

(Note that I originally filed this as an issue on devtools (https://github.com/hadley/devtools/issues/34), but this is really the source.)