| sort {arules} | R Documentation |
Provides the method sort to sort elements
in class associations (e.g., itemsets or rules)
according to the value of measures stored in the association's slot
quality (e.g., support).
## S4 method for signature 'associations'
sort(x, decreasing = TRUE, na.last = NA,
by = "support", ...)
## deprecated since arules version 0.5-1
## S4 method for signature 'associations'
SORT(x, by = "support", na.last = NA,
decreasing = TRUE)
x |
an object to be sorted. |
decreasing |
a logical. Should the sort be increasing or decreasing? (default is decreasing) |
na.last |
for controlling the treatment of |
by |
a character string specifying the quality measure stored in
|
... |
Further arguments passed on to |
An object of the same class as x.
Michael Hahsler
data("Adult")
## Mine frequent itemsets with Eclat.
fsets <- eclat(Adult, parameter = list(supp = 0.5))
## Print the 5 itemsets with the highest support as a data.frame.
as(sort(fsets)[1:5], "data.frame")