if (FALSE) {
data(Groceries)
rules <- apriori(Groceries, parameter=list(support=0.005, confidence=0.5))
rules
inspectDT(rules)
# for more control on the data table, you can used DATAFRAME() to convert the rules.
rules_df <- DATAFRAME(rules, setStart = '', setEnd = '', itemSep = ' + ')
rules_df$count <- NULL
head(rules_df)
inspectDT(rules_df)
# Save HTML widget as web page
p <- inspectDT(rules)
htmlwidgets::saveWidget(p, "arules.html", selfcontained = FALSE)
# Note: self-contained seems to make the browser slow.
# inspect the widget
browseURL("arules.html")
# clean up
unlink(c("arules.html", "arules_files"), recursive = TRUE)}
Run the code above in your browser using DataLab