How to do it...

Perform the following steps to visualize the association rule:

  1. First, you need to install and load the arulesViz package:
        > install.packages("arulesViz")
        > library(arulesViz)  
  1. You can then make a scatter plot from the pruned rules:
        > plot(rules.pruned)
The scatter plot of pruned association rules
  1. Additionally, to prevent overplotting, you can add jitter to the scatter plot:
        > plot(rules.pruned, shading="order", control=list(jitter=6))
The scatter plot of pruned association rules with jitters
  1. We then produce new rules ...

Get Machine Learning with R Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.