Sorting a matrix rowname based on column of another matrix
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
• 775 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Hello Duckula!
We believe that this post does not fit the main topic of this site.
This is a pure R question. Please search StackExchange for an appropriate answer.
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.
Cheers!