Skip to content
Prev 167058 / 398502 Next

Partial sort?

Duncan Murdoch wrote:
Oops, that's wrong.  It's entry 1 of the result which will be placed 
correctly.  This example shows the difference:

 > x <- rep(1:3, 4) + rep(1:4/10, each=3)
 > x
 [1] 1.1 2.1 3.1 1.2 2.2 3.2 1.3 2.3 3.3 1.4 2.4 3.4
 > sort(x, partial=2)
 [1] 1.1 1.2 1.3 1.4 2.2 3.2 3.1 2.3 3.3 2.1 2.4 3.4

Duncan Murdoch