Wolfram Fischer <wolfram <at> fischer-zim.ch> writes: > I have: > d <- sample(10:100, 9) > o <- order(d) > r <- d[o] > How I can get d (in the original order), knowing only r and o? When order acts on a permutation of 1:n it is an involution, i.e. it is its own inverse, therefore: r[order(o)]