I'm not sure how to massage sort or sort.list to do this on a whole array by
one vector, but ...
If COL is the column that you want to sort on and ARRAY is the array you
want to sort, you can
R> INDEX<-sort.list(COL)
R> SORTED.ARRAY<-ARRAY[INDEX,]
Or in 1 step,
R> SORTED.ARRAY<-ARRAY[sort.list(COL),]
Sort.list(COL) gives the indices for COL in increasing order.
John.
On 3/27/03 3:50 PM, "Stanislav Markus" <smarkus(a)fas.harvard.edu> wrote:
hello, all,
how does one sort a dataframe by values in one column..? sort(), rank(),
and order() seem to work only for vectors..
thanks!
stan
_______________________________________________
gov2001-l mailing list
gov2001-l(a)fas.harvard.edu
http://www.fas.harvard.edu/mailman/listinfo/gov2001-l