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

From: Barry Rowlingson <b.rowlingson_at_lancaster.ac.uk>
Date: Wed, 07 Dec 2011 18:34:16 +0000

2011/12/7 Joris Meys <jorismeys_at_gmail.com>:
> @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
_1_
1_9
2_9

 now add the trailing a:

$ sort < f1.txt
1_9a
_1_a
2_9a

[ 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



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel 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 https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive