Is there a way to exhaustively intersect 2 or more lists of integer vectors in R without using for loops? Example for the 2 list (3x2) case:
set.seed(7)
x <- 1:25
x1 <- sample(x, 11)
x2 <- sample(x, 7)
x3 <- sample(x, 15)
list1 <- list(x1 = x1, x2 = x2, x3 = x3)
y <- 1:20
y1 <- sample(y, 13)
y2 <- sample(y, 10)
list2 <- list(y1 = y1, y2 = y2)
So intersect x1 with y1, y2; x2 with y1, y2;, x3 with y1, y2