RE: [R] a R function for sort a data frame.

From: Francisco J. Zagmutt <gerifalte28_at_hotmail.com>
Date: Sat 02 Apr 2005 - 02:55:59 EST


dat<-data.frame(ID=seq(1,10),x=runif(10,2,50)) dat<-dat[sort.list(dat$ID),]

Francisco

>From: bogdan romocea <br44114@yahoo.com>
>To: malfonso@telecom.com.co
>CC: r-help@stat.math.ethz.ch
>Subject: RE: [R] a R function for sort a data frame.
>Date: Fri, 1 Apr 2005 06:07:05 -0800 (PST)
>
>dfr <- data.frame(sample(1:50,10),sample(1:50,10))
>colnames(dfr) <- c("a","b")
>dfr <- dfr[order(dfr$a),]
>dfr <- dfr[order(-dfr$a),]
>
>
>
>-----Original Message-----
>From: Mario Morales [mailto:malfonso@telecom.com.co]
>Sent: Thursday, March 31, 2005 10:23 PM
>To: r-help@stat.math.ethz.ch
>Subject: [R] a R function for sort a data frame.
>
>
>Is there a R function for sort a data frame by a variable ?
>
>I know sort a vector, but I don't know sort a data frame by a
>column. Can you help me ?
>
>the sort() function don't work with data frame.
>
>______________________________________________
>R-help@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
>
>______________________________________________
>R-help@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



R-help@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 Received on Sat Apr 02 05:38:09 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:00 EST