I have two data frames. One contains a large amount of data. The second contains less data with some matching row names.
data frame A
Row.names data
1 A
2 B
3 C
4 D
5 E
data frame B
Row.names data
1 X
3 Y
5 Z
I want to extract data from data frame A using row.names from data frame B to create:
data frame C
Row.names data
1 A
3 C
5 E
Basically, I want to use to group names from data frame B into a subset of data from data frame A, which has the same row names.
Any help would be appreciated.
source
share