Reputation: 655
I need to sort the following data.frame (table 1):
X Y
A 1
B 5
C 0
D 3
based on the results of another data.frame (table 2):
X Y
C 10
B 9
A 8
D 7
So, data.frame # 1 ends like this:
X Y
C 0
B 5
A 1
D 3
How do I do this? I've tried to use:
table1[order(row names(table1),]
But I get the following error:
Subscript out of bound.
Upvotes: 1
Views: 265