Symmetric set difference
symdiff(x, y)
x | a vector |
---|---|
y | a vector of the same type as |
the symmetric difference of set x
and y
.
Weisstein, Eric W. "Symmetric Difference." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/SymmetricDifference.html
x <- c(1, 2, 3, 4) y <- c(1, 4, 5) symdiff(x, y)#> [1] 2 3 5x <- letters[1:4] y <- letters[2:6] symdiff(x, y)#> [1] "a" "e" "f"