[R] Sorting a dataframe

Spencer Graves spencer.graves at pdf.com
Tue Aug 12 19:03:12 CEST 2003

Why won't "order" solve your problem?  "?order" in R 1.7.1 for Windows 
includes an example sorting lexicographically 3 variables in ascending 

spencer graves

Paul, David A wrote:
> Undoubtedly a simple question:
> I've looked at order() and sort() in the help pages for
> R1.7.1.  It doesn't appear that these functions are immediately
> suited to doing the same thing as
> 	BY X Y Z;
> RUN;
> in SAS.  I have also checked Frank Harrell's Hmisc library.
> Could someone point me in the right direction so I can sort 
> by the levels of Z within the levels of Y within the levels 
> of X?  Everything needs to be in ascending order.
> Much thanks in advance,
>   david paul
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help

More information about the R-help mailing list