[R] inverse function of order()

Deepayan Sarkar deepayan at stat.wisc.edu
Mon Oct 4 17:01:09 CEST 2004


On Monday 04 October 2004 09:21, Wolfram Fischer wrote:
> 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?

Perhaps

r[order(o)]

Deepayan




More information about the R-help mailing list