Skip to contents

set_symmetric_difference returns elements in either x or y but not in both. This function mimics Python's set.symmetric_difference() method.

Usage

sets_symmetric_difference(x, y)

Arguments

x

A vector.

y

Another vector to compare with.

Value

A vector containing elements unique to either x or y.

Examples

sets_symmetric_difference(c(1, 2, 3), c(3, 4, 5))
#> [1] 1 2 4 5