Description Usage Arguments Details Value See Also Examples
View source: R/operation_setsymdiff.R
Returns the symmetric difference of two objects inheriting from class Set
.
1 2 3 | setsymdiff(x, y, simplify = TRUE)
x %-% y
|
x, y |
Set |
simplify |
logical, if |
The symmetric difference, aka disjunctive union, of two sets, X, Y, is defined as the set of elements that exist in set X or in Y but not both,
{z : (z ε X or z ε Y) and !(z ε X and z ε Y)}
The symmetric difference can also be expressed as the union of two sets minus the intersection.
Therefore setsymdiff
is written as a thin wrapper over these operations, so for two sets, A,B
:
A %-% B = (A | B) - (A & B)
.
The symmetric difference of fuzzy and crisp sets first coerces fuzzy sets to crisp sets by finding their support.
An object inheriting from Set
containing the symmetric difference of elements in both x
and y
.
Other operators:
powerset()
,
setcomplement()
,
setintersect()
,
setpower()
,
setproduct()
,
setunion()
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.