Entering edit mode
5.5 years ago
Duckula
▴
50
Dear all, I have two matrices similar to below:
a b c d id1 id2 id3 id4
1 2 3 4 b 1 2 3
6 7 8 9 c 0 2 4
d 1 2 2
a 5 6 8
And I want to sort the row name of the left matrix according to the first column (id1) of the second matrix. Does anyone has any suggestion that how can it be processed ? I was simply trying "first matrix"[colnames("second matrix"),]. but it was not that easy.
Thanks