The ordering index vector is a vector that contains indices of another vector. It’s basically the other vector, but ordered (decreasing or increasing). Instead of having the values it has the indices :) I spent close to an hour to find this line :) And here it is. In all its glory :)
The result of this command is a bit strange (for me). It returns an object that contains the ordered vector and the ordered index vector in a list. Long story short, I can’t access them like I would want to. So the command I ended up using is a bit more complex:
Notice that I coerce the resulting list into a matrix. This results in a matrix containing two elements: ->ordered vector and -> ordered index vector. Therefore I chose the second element in the returned list and unlisted it into a vector. This is what I wanted as I can index a vector :)
sort.int(VECTOR, index.return=TRUE)$ix is the way where to go.
Wouldn’t using order(VECTOR) do the trick? it returns a vector and is easy to use :)
This was such a long time ago that I forgot what I used it for. I think order(VECTOR) would have also served my purposes, and its simpler. Thx for the feedback :)