symdiff: Set operation symmetric difference

View source: R/symdiff.R

symdiffR Documentation

Set operation symmetric difference

Description

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.

Usage

symdiff(x, y)

Arguments

x

[vector]
Vector containing a sequence of items.

y

[vector]
Another vector containing a sequence of items.

Value

A vector with elements of the symmetric difference of y and y.

Examples

symdiff(1:10, 6:15)
symdiff(1:10, 1:20)
symdiff(c("a", "b", "c"), c("d", "c", "c", "d", "e"))

jakobbossek/re documentation built on Nov. 15, 2024, 1:42 a.m.