[R] inverse function of order()
Dimitris Rizopoulos
dimitris.rizopoulos at med.kuleuven.ac.be
Mon Oct 4 16:55:50 CEST 2004
Hi Wolfram,
just use:
r[order(o)]
I hope it helps.
Best,
Dimitris
----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/396887
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm
----- Original Message -----
From: "Wolfram Fischer" <wolfram at fischer-zim.ch>
To: <r-help at stat.math.ethz.ch>
Sent: Monday, October 04, 2004 4:21 PM
Subject: [R] inverse function of order()
>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?
>
> Thanks - Wolfram
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
More information about the R-help
mailing list