Message-ID: <01011219550500.00804@ligarto>
Date: 2001-01-12T18:54:08Z
From: Ramon Diaz-Uriarte
Subject: sorting ascending descending?
In-Reply-To: <3A5F430A.D7B14AE6@molgen.mpg.de>
On Fri, 12 Jan 2001, Witold Eryk Wolski wrote:
> HI!
> By xx[order(xx)] I can sort the array ascendin. How to sort them
> descending.
>
> eg.:
> > a<-c(2,3,110,23,4)
> > a[order(a)]
> [1] 2 3 4 23 110
>
> but i wont.
> [1] 110 23 4 3 2
>
You can do:
a[order(-a)]
Ramón
--
Ramón DÃaz-Uriarte
Triana 47
28016 Madrid
Spain
email:ramon-diaz at teleline.es
Phone: +-34-918-513-966
+-34-657-186-407
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._