[R] Sorting a dataframe by one column?

mtb954 mtb954 mtb954 at gmail.com
Fri Feb 24 14:54:31 CET 2006


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




More information about the R-help mailing list