Create visualizations of association rules
Arguments
- rules_obj
A tidy_apriori object or an arules rules object. A table of rules is refused: the plots need the rules object.
- method
Visualization method: "scatter" (default), drawn by tidylearn, or a method of arulesViz's
plot(), such as "graph", "grouped", "matrix" or "paracoord"- top_n
Number of rules to visualize, those with the highest lift (default: 50)
- ...
Additional arguments passed to plot() for rules visualization
Value
For method = "scatter", a ggplot
object. Other methods return what arulesViz's plot()
returns: a ggplot object for "graph", "grouped" and "matrix", and for
"paracoord", which draws with grid, a grid vpPath.
Examples
# \donttest{
if (requireNamespace("arules", quietly = TRUE)) {
data("Groceries", package = "arules")
res <- tidy_apriori(Groceries, support = 0.001, confidence = 0.5)
visualize_rules(res, method = "scatter")
}
# }
