Suppose I have two matrices, each with two columns and differing numbers of row. I want to check and see which pairs of one matrix are in the other matrix. If these were one-dimensional, I would normally just do a %in% x
to get my results. match
seems only to work on vectors.
> a
[,1] [,2]
[1,] 1 2
[2,] 4 9
[3,] 1 6
[4,] 7 7
> x
[,1] [,2]
[1,] 1 6
[2,] 2 7
[3,] 3 8
[4,] 4 9
[5,] 5 10
I would like the result to be c(FALSE,TRUE,TRUE,FALSE)
.