Provides the generic functions and the methods for the set operations
union()
, intersect()
, setequal()
, setdiff()
and
is.element()
on sets of associations (e.g., rules, itemsets) and
itemMatrix.
# S3 method for itemMatrix
union(x, y, ...)# S3 method for associations
union(x, y, ...)
# S4 method for associations
union(x, y, ...)
# S4 method for itemMatrix
union(x, y, ...)
# S3 method for itemMatrix
intersect(x, y, ...)
# S3 method for associations
intersect(x, y, ...)
# S4 method for associations
intersect(x, y, ...)
# S4 method for itemMatrix
intersect(x, y, ...)
# S3 method for itemMatrix
setequal(x, y, ...)
# S3 method for associations
setequal(x, y, ...)
# S4 method for associations
setequal(x, y, ...)
# S4 method for itemMatrix
setequal(x, y, ...)
# S3 method for itemMatrix
setdiff(x, y, ...)
# S3 method for associations
setdiff(x, y, ...)
# S4 method for associations
setdiff(x, y, ...)
# S4 method for itemMatrix
setdiff(x, y, ...)
# S3 method for itemMatrix
is.element(el, set, ...)
# S3 method for associations
is.element(el, set, ...)
# S4 method for associations
is.element(el, set, ...)
# S4 method for itemMatrix
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
.
sets of associations or itemMatrix objects.
Other arguments are unused.
Michael Hahsler
Technical note: 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()
.
Other associations functions:
abbreviate()
,
associations-class
,
c()
,
duplicated()
,
extract
,
inspect()
,
is.closed()
,
is.generator()
,
is.maximal()
,
is.redundant()
,
is.significant()
,
is.superset()
,
itemsets-class
,
match()
,
rules-class
,
sample()
,
size()
,
sort()
,
unique()
Other itemMatrix and transactions functions:
abbreviate()
,
c()
,
crossTable()
,
duplicated()
,
extract
,
hierarchy
,
image()
,
inspect()
,
is.superset()
,
itemFrequency()
,
itemFrequencyPlot()
,
itemMatrix-class
,
match()
,
merge()
,
random.transactions()
,
sample()
,
size()
,
supportingTransactions()
,
tidLists-class
,
transactions-class
,
unique()
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