funchir-infix | R Documentation |
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 |
A set |
B |
idem |
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
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.