# NOT RUN {
data("Groceries")
rules <- apriori(Groceries, parameter=list(support = 0.01, confidence = 0.5))
# convert rules into a graph
g <- associations2igraph(rules)
g
plot(g)
# save rules as a graph so they can be visualized using external tools
saveAsGraph(rules, "rules.graphml")
## clean up
unlink("rules.graphml")
# }
Run the code above in your browser using DataLab