Hello,
I have a data.frame which I would like to sort with the primary key
decreasing while the secondry key is increasing e.g.
x - data.frame(One=c(1,1,1,2,2,3,4,5),Two=c(2,3,1,2,3,3,3,3))
I would like to order it so it looks like this:
One Two
8 5 3
7 4 3
6 3 3
4 2 2
5 2
How about this:
x[order(x$One,-x$Two,decreasing=T),]
One Two
8 5 3
7 4 3
6 3 3
4 2 2
5 2 3
3 1 1
1 1 2
2 1 3
2009/6/24 Daniel Brewer daniel.bre...@icr.ac.uk:
Hello,
I have a data.frame which I would like to sort with the primary key
decreasing while the
2 matches
Mail list logo