Learn R Programming

arules (version 0.2-6)

SORT: Sorting Associations

Description

Provides the generic function SORT and the S4 method 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).

Usage

SORT(x, ...)
## S3 method for class 'associations':
SORT(x, by = "support", decreasing = TRUE)

Arguments

x
an object to be sorted.
...
further arguments.
by
a character string specifying the quality measure stored in x to be used to sort x.
decreasing
"logical"; should the sort be increasing or decreasing? (default is decreasing)

Value

  • An object of the same class as x.

See Also

associations-class

Examples

Run this code
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 list.
as(SORT(fsets)[1:5], "list")

Run the code above in your browser using DataLab