Finding elements that do not overlap between two vectors
overlap, r
Solution
Yes, there is a way:
setdiff(list.a, list.b)
# [1] "Mary" "Jack" "Michelle"
Problem
I'm trying to identify elements which are not included in the other vector. For instance in two vectors I have ``` list.a <- c("James", "Mary", "Jack", "Sonia", "Michelle", "Vincent") list.b <- c("James", "Sonia", "Vincent") ``` is there a way to verify which people do not overlap? In the example, I would want to get the vector result that contains Mary, Jack, and Michelle. Any suggestions will help!