Several infix operators which are convenient shorthand for common set operations, namely, modulation (A\B), union (AUB) and intersection (A & B).
A %\% B A %u% B A %^% B
A set A.
A
idem A.
The above are simply wrappers for the base functions setdiff, union, and intersect, respectively, so output is exactly as for those functions.
setdiff
union
intersect
setdiff , union, intersect
# NOT RUN { set1 <- 1:5 set2 <- 4:6 set1 %\% set2 # c(1,2,3) set1 %u% set2 # c(1,2,3,4,5,6) set1 %^% set2 # c(4,5) # }
Run the code above in your browser using DataCamp Workspace