Learn R Programming

R package arulesViz - Visualizing Association Rules and Frequent Itemsets

This R package extends package arules with various visualization techniques for association rules and itemsets. The package also includes several interactive visualizations for rule exploration.

Installation

Stable CRAN version: Install from within R with

install.packages("arulesViz")

Current development version: Install from r-universe.

install.packages("arulesViz", repos = "https://mhahsler.r-universe.dev")

This might also require the development version of arules.

Features

  • Visualizations using engines ggplot2 (default engine for most methods), grid, base (R base plots), htmlwidget (powered by plotly and visNetwork).
  • Interactive visualizations using grid, plotly and visNetwork.
  • Interactive rule inspection with datatable.
  • Integrated interactive rule exploration using ruleExplorer.

Available Visualizations:

  • Scatterplot, two-key plot
  • Matrix and matrix 3D visualization
  • Grouped matrix-based visualization
  • Several graph-based visualizations
  • Doubledecker and mosaic plots
  • Parallel Coordinate plot

Usage

Mine some rules.

library("arulesViz")
data("Groceries")
rules <- apriori(Groceries, parameter = list(support = 0.005, confidence = 0.5))
## Apriori
## 
## Parameter specification:
##  confidence minval smax arem  aval originalSupport maxtime support minlen
##         0.5    0.1    1 none FALSE            TRUE       5   0.005      1
##  maxlen target  ext
##      10  rules TRUE
## 
## Algorithmic control:
##  filter tree heap memopt load sort verbose
##     0.1 TRUE TRUE  FALSE TRUE    2    TRUE
## 
## Absolute minimum support count: 49 
## 
## set item appearances ...[0 item(s)] done [0.00s].
## set transactions ...[169 item(s), 9835 transaction(s)] done [0.00s].
## sorting and recoding items ... [120 item(s)] done [0.00s].
## creating transaction tree ... done [0.00s].
## checking subsets of size 1 2 3 4 done [0.00s].
## writing ... [120 rule(s)] done [0.00s].
## creating S4 object  ... done [0.00s].

Standard visualizations

plot(rules)

plot(rules, method = "graph", limit = 20)

Interactive visualization

Live examples for interactive visualizations can be seen in Chapter 5 of An R Companion for Introduction to Data Mining

References

Copy Link

Version

Install

install.packages('arulesViz')

Monthly Downloads

15,417

Version

1.5-2

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

March 7th, 2023

Functions in arulesViz (1.5-2)

ruleExplorer

Explore Association Rules Interactively
inspectDT

Inspect Associations Interactively Using datatable
rules2matrix

Convert association rules into a matrix
associations2igraph

Convert rules or itemsets into a graph
plot

Visualize Association Rules and Itemsets