plotly_arules: Interactive Scatter Plot for Association Rules using plotly

Description Usage Arguments Value Examples

View source: R/plotly.R View source: R/plotly.R

Description

Plot an interactive scatter plot for association rules using plotly. This function is deprecated. Use plot with parameter engine = "plotly" instead.

Usage

1
2
plotly_arules(x, method = "scatterplot", measure = c("support", "confidence"), 
  shading = "lift", max = 1000, ...)

Arguments

x

an object of class "rules".

method

currently the methods "scatterplot", "two-key plot" and "matrix" are supported.

measure

measure(s) of interestingness (e.g., "support", "confidence", "lift", "order") used in the visualization as x and y-axis.

shading

measure of interestingness used for color shading.

max

client side processing in plotly is expensive. We restrict the number of rules to the max best rules (according to the measure used for shading.)

...

The following additional arguments can be used: colors to specify a color palette, precision to specify the precision used for printing quality measures, jitter to reduce overplotting in scatterplots (defaults to .1 if overplotting would occur), and marker with a list of markter attributes (e.g., size, symbol and opacity).

Value

The plotly object (plotly_hash) which can be saved as a htmlwidget.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run:  
library(plotly)
data(Groceries)
rules <- apriori(Groceries, parameter=list(support=0.001, confidence=0.8))
rules

# interactive scatter plot visualization
plotly_arules(rules)
plotly_arules(rules, measure = c("support", "lift"), shading = "confidence")
plotly_arules(rules, method = "two-key plot")

# add jitter, change color and markers and add a title
plotly_arules(rules, jitter = 10, 
  marker = list(opacity = .7, size = 10, symbol = 1), 
  colors = c("blue", "green")) 


# save a plot as a html page
p <- plotly_arules(rules)
htmlwidgets::saveWidget(p, "arules.html", selfcontained = FALSE)
browseURL("arules.html")
# Note: selfcontained seems to make the browser slow.

# interactive matrix visualization
plotly_arules(rules, method = "matrix") 

## End(Not run)

mhahsler/arulesViz documentation built on Dec. 5, 2018, 6:08 p.m.