intsect: Intersect

Description Usage Arguments Details Value Examples

View source: R/intsect.R

Description

Performs set intersection on a list of vectors

Usage

1

Arguments

x

list of sets (vectors of same mode or factors)

Details

The intersection between the sets in the list is found. This means no duplicate values are returned, whether or not there were any in the input.

Value

A vector of same mode as input, or a single factor object if input was factor.

Examples

1
2
3
4
5
6
intsect(list(0:6, c(2, 4, 6, 8), 3:8))

fc <- factor(LETTERS[sample(1:5, 20, rep=TRUE)])
fcl <- split(fc, sample(1:3, 20, rep=TRUE))

intsect(fcl)

AkselA/R-ymse documentation built on March 21, 2020, 9:52 a.m.