Off topic:Sorting a matrix rowname based on column of another matrix
0
0
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

R Matrix • 665 views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 2094 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6