Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sets

Set Operations


Description

Provides the generic functions and the S4 methods for the set operations union, intersect, setequal, setdiff and is.element on sets of associations (e.g., rules, itemsets) and itemMatrix.

Usage

union(x, y)
intersect(x, y)
setequal(x, y)
setdiff(x, y)
is.element(el, set)

Arguments

x,y, el, set

sets of associations or itemMatrix objects.

Details

All S4 methods for set operations are defined for the class name "ANY" in the signature, so they should work for all S4 classes for which the following methods are available: match, length and unique.

Value

union, intersect, setequal and setdiff return an object of the same class as x and y.

is.element returns a logic vector of length el indicating for each element if it is included in set.

Author(s)

Michael Hahsler

See Also

Examples

data("Adult")

## mine some rules
r <- apriori(Adult)

## take 2 subsets
r1 <- r[1:10]
r2 <- r[6:15]

union(r1,r2)
intersect(r1,r2)
setequal(r1,r2)

arules

Mining Association Rules and Frequent Itemsets

v1.6-7
GPL-3
Authors
Michael Hahsler [aut, cre, cph], Christian Buchta [aut, cph], Bettina Gruen [aut, cph], Kurt Hornik [aut, cph], Ian Johnson [ctb, cph], Christian Borgelt [ctb, cph]
Initial release
2021-03-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.