[R] Sorting a dataframe by one column?

From: mtb954 mtb954 <mtb954_at_gmail.com>
Date: Sat 25 Feb 2006 - 00:54:31 EST


Given the following dataframe:

A=1:10
B=(a-5)^2
DATAFRAME=data.frame(A,B)

How can I sort DATAFRAME increasing (or decreasing, for that matter) by B without making reference to A, or any other column?

I've read ?order and ?sort but cannot seem to figure this out.

Thank you.

Mark



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 Feb 25 01:12:33 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:45 EST