subset {arules} | R Documentation |
Provides the generic function subset
and S4 methods to subset
associations or transactions (itemMatrix) which meet certain conditions
(e.g., contains certain items or satisfies a minimum lift).
subset(x, ...) ## S4 method for signature 'itemMatrix': subset(x, subset, ...) ## S4 method for signature 'itemsets': subset(x, subset, ...) ## S4 method for signature 'rules': subset(x, subset, ...) ## S4 method for signature 'itemMatrix': subset(x, subset, ...)
x |
object to be subsetted. |
subset |
logical expression indicating elements to keep. |
... |
further arguments to be passed to or from other methods. |
An object of the same class as x
containing only the
elements which satisfy the conditions.
itemMatrix-class
,
itemsets-class
,
rules-class
,
transactions-class
data("Adult") rules <- apriori(Adult) ### subset the rules rules.sub <- subset(rules, subset = rhs %in% "marital-status=Never-married" & lift > 2)