[R] how can i sort a column of data.frame ?
Weidong Gu
wgu at uab.edu
Mon May 19 20:56:56 CEST 2008
? 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.
More information about the R-help
mailing list