Reputation: 13
I have marker data (as matrix) marker, where rownames are names of the individuals and colnames are names of the markers.
marker <-
BBLM062 BBLM00182 BBLMOO587.......
ALEN294945 AA AA AT ....
ALEN29394 AT AA TT ....
ALEN49494888 AT AA TT ....
ALEN26424 AA AA AA ....
ALEN38764 AA AT AA ....
ALEN29794 AA AT AA ....
......
(282 x 1082)
I have another dataset pheno (also as a matrix) where rownames are names on indviduals colnames are names of the traits
pheno <-
height weight colour ......
ALEN26494 162 3.5 3
ALEN49494888 154 3.8 5
ALEN494967 131 4.0 5
ALEN49678 152 3.9 7
ALEN294945 138 4.9 1
.......
(260 x 7)
all the individuals in 'pheno' are also present in 'marker' but not in the same order. I have 3 questions
Thanks in advance .
Upvotes: 0
Views: 138
Reputation: 4358
You will get a lot more help if you share reproducible examples. You can use the dput( )
function to help share your data.
you can subset with this code:
marker[row.names(marker) %in% row.names(pheno),]
Upvotes: 0