ListSetOperations: Set operations on lists of character vectors.

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Set operations on lists of character vectors.

Usage

1
2
3
4
5
Intersect(x)

Setdiff(x, y)

Union(x)

Arguments

x

A list of character vectors.

y

A list of character vectors.

Details

These functions perform basic set operations on lists of character vectors in a recursive manner. The work analogous to union, intersect, and setdiff but on lists.

Value

Intersect returns the intersection of all vectors in x.

Setdiff returns the intersection of x minus the union of y.

Union returns the union all character vectors in x.

Author(s)

Anders Ellern Bilgrau <anders.ellern.bilgrau (at) gmail.com>

See Also

union, intersect, setdiff

without

Examples

1
2
3
4
5
6
7
set.seed(1)
x <- lapply(2:6, function(i) sample(LETTERS, 10+i))
y <- lapply(1:3, function(i) sample(LETTERS, 2+i))

Union(x)  # The union of all vectors in x
Intersect(x)  # The intersection of all vectors in x
Setdiff(x, y)  # All elements in the intersection of x, but not in any y

AEBilgrau/Bmisc documentation built on May 5, 2019, 11:28 a.m.