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

From: Romain Francois <francoisromain_at_free.fr>
Date: Sat 02 Apr 2005 - 01:23:58 EST

Le 01.04.2005 05:22, Mario Morales a écrit :

> 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.
>
take a look at ?order as in :
A <- data.frame(x=c(1,6,3),y=c(2,4,9))
A[order(A$x),]

-- 
Romain FRANCOIS : francoisromain@free.fr
page web : http://addictedtor.free.fr/  (en construction)
06 18 39 14 69 / 01 46 80 65 60
_______________________________________________________
Etudiant en 3eme année
Institut de Statistique de l'Université de Paris (ISUP)
Filière Industrie et Services
http://www.isup.cicrp.jussieu.fr/

______________________________________________
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 03:43:50 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:59 EST