
union
, intersect
, setequal
, setdiff
and
is.element
on sets of associations (e.g., rules, itemsets) and
itemMatrix.union(x, y)
intersect(x, y)
setequal(x, y)
setdiff(x, y)
is.element(el, set)
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
.
"ANY"
in the signature,
so they should work for all S4 classes for which the following
methods are available: match
, length
and unique
.associations-class
,
itemMatrix-class
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)
Run the code above in your browser using DataLab