Learn R Programming

arulesViz (version 1.5-0)

inspectDT: Inspect Associations Interactively Using datatable

Description

Uses datatable to create a HTML table widget using the DataTables library. Rules can be interactively filtered and sorted.

Usage

inspectDT(x, ...)

Arguments

x

an object of class "rules" or "itemsets".

...

additional arguments. precision controls the precision used to print the quality measures (defaults to 2). All other arguments are passed on to datatable in package DT.

Value

A datatable htmlwidget.

References

Hahsler M (2017). arulesViz: Interactive Visualization of Association Rules with R. R Journal, 9(2):163-175. ISSN 2073-4859. 10.32614/RJ-2017-047.

See Also

datatable in DT.

Examples

Run this code
# NOT RUN {
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 a datatable as a html page.
p <- inspectDT(rules)
htmlwidgets::saveWidget(p, "arules.html", selfcontained = FALSE)
browseURL("arules.html")
# }

Run the code above in your browser using DataLab