For example, I have two vectors:
x1 <- c(0,1,2)
x2 <- c(1,2,0,1,2,3,4,5,0,1,0,1,2)
I would like to find the position where x1 is first present x2, which is in this case is 3.
I have tried which(), match(), but both seems to find elements, instead of vectors. Is there a R function that can achieve this or a way to construct one?
Thank you!