? 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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of hanen Sent: Monday, May 19, 2008 1:11 PM To: r-help@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@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@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.