If you have a row vector and you want to know what a match. This is a simple matter of using% in%.
x <- c("red","blue","green")
y <- c("yellow","blue","orange")
which(x %in% y)
But what about the opposite, where would you like to find which X are not in Y?
source
share