Skip to content
Prev 58469 / 398502 Next

Unexpected results from sort function when partial and index are used

On Wed, 3 Nov 2004, Tuszynski, Jaroslaw W. wrote:

            
You cannot.  There is no underlying code to do so, and the person who 
added 'index.return' forgot this case.  I was against having it at all -- 
we have sort.list for that purpose.  I've updated the documentation.

Sundar's match() solution will not work if there are duplicate values.  
If you need the index, just do a full sort -- partial sorting is only 
implemented for efficiency reasons, and nowadays full sorting is fast 
enough even on massive vectors.