# NOT RUN {
data(Groceries)
rules <- apriori(Groceries, parameter=list(support = 0.001, confidence = 0.8))
rules
## Matrix
m <- rules2matrix(rules[1:10], measure = "lift")
m
plot(rules[1:10], method = "matrix")
## Grouped matrix
# create a matrix with LHSs grouped in k = 10 groups
m <- rules2groupedMatrix(rules, k = 10)
m$m
# number of rules per group
table(m$clustering_rules)
# get rules for group 1
inspect(rules[m$clustering_rules == 1])
# the corresponding plot
plot(rules, method = "grouped matrix", k = 10)
# }
Run the code above in your browser using DataLab