Re: [R] Sorting a data frame by one of the variables

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Sun 16 Oct 2005 - 14:59:56 EST

Try

RSiteSearch("sort data.frame")
?order
RSiteSearch("sort.data.frame")

On 10/16/05, Leaf Sun <leaflovesun@yahoo.ca> wrote:
>
> Dear all,
>
> I have a date frame like this:
>
> X Y Z
> 22 24 4.3
> 2.3 3.4 5.3
> .....
> ....
> 57.2 23.4 34
>
> What my purpose is: to sort the data frame by either X, Y or Z.
> sample output is (sorted by X) :
>
> X Y Z
> 2.3 3.4 5.3
> .....
> ......
> 22 24 4.3
> ...
> 57.2 23.4 34
>
> I have no idea how to use sort, order or rank functions. Please help me out.
> Thanks!
>
> Leaf
>
>
>
> ______________________________________________
> 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 Sun Oct 16 15:19:39 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 18:56:02 EST