Re: [R] order() function, decreasing=TRUE unexpected behaviour

2013-11-17 Thread Hawthorne Beyer
14:38 To: Hawthorne Beyer; r-help@r-project.org Subject: Re: [R] order() function, decreasing=TRUE unexpected behaviour I think you are confused, and there is no problem with the order function. Keep in mind that order returns the index values in a sequence such that when the result of the order

Re: [R] order() function, decreasing=TRUE unexpected behaviour

2013-11-16 Thread Jeff Newmiller
I think you are confused, and there is no problem with the order function. Keep in mind that order returns the index values in a sequence such that when the result of the order function is used as indexes for the original sequence then the data will be sorted as desired. You may see the error of

[R] order() function, decreasing=TRUE unexpected behaviour

2013-11-16 Thread Hawthorne Beyer
There appears to be an issue with the decreasing=TRUE option on the order() function that indicates either a bug or perhaps a design flaw (potentially flawed because I would suggest the majority of users would expect different behaviour). # demonstration of problem: x <- c(2,1,3,4,5) order(x) o