Performs symmetric(!) set difference in contrast
to setdiff
. I.e. given two vectors (of the same mode) the result
contains all elements that are either in the first or the second vector
but not in both. Duplicated values in the arguments will be discarded.
symdiff(x, y)
x | [ |
---|---|
y | [ |
A vector with elements of the symmetric difference of y
and y
.
symdiff(1:10, 6:15)#> [1] 1 2 3 4 5 11 12 13 14 15symdiff(1:10, 1:20)#> [1] 11 12 13 14 15 16 17 18 19 20#> [1] "a" "b" "d" "e"