powered by
Unlike intersect, it does not remove duplicates in x and keeps its order.
intersect
keep_if_in(x, y)x %if_in% y
x %if_in% y
Source vector.
Destination vector (of the same mode as x).
A filtered version of x.
keep_if_not_in
# NOT RUN { keep_if_in(1:5, 3:6) # returns [3, 4, 5] keep_if_in(c(4, 3, 4, 3, 1), 3:6) # returns [4 3 4 3] # }
Run the code above in your browser using DataLab