I have a matrix that I would like to subset. When I subset it the output I want is the value of its rowname.
m
x y
A 2 2
B 2 2
C 1 3
D 1 1
E 1 2
m2
x y
1 1 2
This is what I currently have, which is clearly not the right output. This seems straightforward, but I've yet to have it figured out.
which(m2==m, arr.ind=TRUE)
row col
1 1 2
The output should be
output
"E"
m2 can have more than 1 line to subset m with.