Symmetric set complement

symdiff(x, y)

Arguments

x

a vector

y

a vector

Value

union(setdiff(x, y), setdiff(y, x))

Note

that symdiff(x, y) is not identical() as symdiff(y, x) without applying sort() to the result

See also

Examples

symdiff(c(1L, 2L, 2L), c(2L, 3L))
#> [1] 1 3
symdiff(c(2L, 3L), c(1L, 2L, 2L))
#> [1] 3 1