Re: [R] how can i sort a column of data.frame ?

From: Weidong Gu <wgu_at_uab.edu>
Date: Mon, 19 May 2008 13:56:56 -0500

? order

df<-data.frame(a=rnorm(20),b=rpois(20,5),c=runif(20)) or<-order(df$b,decreasing=T)
df.or<-df[or,]

Weidong Gu
Department of Medicine
University of Alabama, Birmingham
1900 University Blvd., Birmingham, Alabama 35294

-----Original Message-----
From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] On Behalf Of hanen
Sent: Monday, May 19, 2008 1:11 PM
To: r-help_at_r-project.org
Subject: [R] how can i sort a column of data.frame ?

i have a data.frame with several columns that i want to sort one of them (one
column) by descending order
 in such way that this sorting out recover all colums. what should i do?

-- 
View this message in context:
http://www.nabble.com/how-can-i-sort-a-column-of-data.frame---tp17324725
p17324725.html
Sent from the R help mailing list archive at Nabble.com.


______________________________________________
R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Received on Mon 19 May 2008 - 19:49:47 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 19 May 2008 - 20:30:48 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive