Skip to content
Prev 208005 / 398502 Next

Problem with multy level sorting

On Jan 29, 2010, at 9:34 AM, venkata kirankumar wrote:

            
a, b and d are not objects. They are columns within ff.

  with( ff, order(a,b,d))
#[1] 8 3 4 5 1 2 7 6
The ordering of that dataframe would be (almost) uniquely determined  
by ordering on the first column. Even the one duplicate (3) gets  
resolved with reference to the second column.

ff[with(ff, order(a,b,d)), ]

    a  b  d
8  3  2  8
3  3  8 10
4  5  6  8
5  6  3  5
1 10  5  7
2 20  4  9
7 45 28  9
6 73  7  3
David Winsemius, MD
Heritage Laboratories
West Hartford, CT