I have two lists or similar, and I want to get the items in big_list
that are not in little_list
.
big_list <- c(1,2,3,4,5)
little_list <- c(2,4)
big_list[big_list %in% little_list] # this gives me the interection
But I want the complement (items in big_list that aren't in little_list, i.e. big_list\little_list
).
This doesn't work
big_list[big_list ! %in% little_list]
Neither does this
big_list[big_list %in% ! little_list]
I am assuming there is an answer I should have worked out by myself?!