munion: Operations for multiple sets

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

View source: R/set.R

Description

Set operation functions in the base package, union, intersect and setdiff, can only be applied to binary manipulations involving two sets. Following functions, munion, mintersect and msetdiff, extend their basic versions to deal with multiple sets.

Usage

1

Arguments

...

Vectors of items, or a list of them. See examples below.

Details

These functions apply set manipulations (union, intersect, or difference) in a sequential manner: the first two sets are considered first, then the third, the fourth and so on, till all sets have been visited.

Value

A vector of set operation results. Can be an empty vector if no results were returned.

Author(s)

Jitao David Zhang <jitao_david.zhang@roche.com>

See Also

union, intersect and setdiff.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
set1 <- c("HSV", "FCB", "BVB", "FCN", "HAN")
set2 <- c("HSV", "FCB", "BVB", "HAN")
set3 <- c("HSV", "BVB", "FSV")

munion(set1, set2, set3)
mintersect(set1, set2, set3)
msetdiff(set1, set2, set3)

## sets can be given in a list as well
munion(list(set1, set2, set3))
mintersect(list(set1, set2, set3))
msetdiff(list(set1, set2, set3))

ribiosUtils documentation built on March 13, 2020, 2:54 a.m.