I have two vectors:
v1 <- c(1,2,3)
v2 <- c(4,5,6)
How can I check which (if any) elements in list1 is present in list2? The above case should return NULL.
Here's another case:
v1 <- c(1,2,3)
v3 <- c(3,4,5)
In this case, the answer should be 3
.
Is there an elegant way to do this?
Thank you!