Series of functions extending existing vector operations to lists of vectors.
Usage
setmatch(x, y, nomatch = NA_integer_)
subsetmatch(x, y, nomatch = NA_integer_)
setsetdiff(x, y)
setsetequal(x, y)
Arguments
x
list of vectors.
y
list of vectors.
nomatch
value to be returned in the case when no match is found.
Note that it is coerced to integer.
Value
setmatch and subsetmatch return a vector of integers of length
the same as the list x.
setsetdiff returns a sublist x.
setsetequal returns a logical of length 1.
Details
setmatch checks whether each vector in the list x is also
contained in the list y, and if so returns position of the first such
vector in y. The ordering of the elements of the vector is irrelevant,
as they are considered to be sets.
subsetmatch is similar to setmatch, except vectors in x
are searched to see if they are subsets of vectors in y.
setsetdiff is a setwise version of setdiff, and setsetequal
a setwise version of setequal.