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

From: Barry Rowlingson <>
Date: Wed, 07 Dec 2011 18:34:16 +0000

2011/12/7 Joris Meys <>:
> @Barry : regardless of whether '_' comes before or after '1' , it
> should be consistent. Adding an 'a' shouldn't shift '_' from before
> '1' to between '1' and '2', that's clearly an error. The help files
> are not stating anything about that.

 That's an assumption. The help pages are quite clear about making assumptions.

 The only way this could be a 'bug' is if you can show that the sort order in R is different from the lexicographic sort order using the collating sequence of the locale in use. But even my command line 'sort' agrees:

$ sort < f1.txt

 now add the trailing a:

$ sort < f1.txt

[ I had a thought maybe it was because _ is sometimes used to break thousands in numeric formats, but I can't get any obvious consistency out of that hypothesis ]

Barry mailing list Received on Wed 07 Dec 2011 - 18:35:57 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 07 Dec 2011 - 23:30:15 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive