arulesApp: Assocation Rules Visualization Shiny App

Description Usage Arguments Value See Also Examples

Description

Launches a Shiny App that provides an interactive interface to the visualizations of the arulesViz package. The app allows users to mine rules based on all or just subsets of features, sort by criteria (lift, support, confidence) and visualize using network graph, grouped bubble and scatter plots.
Users filter rules to target only those with a certain variable on the RHS or LHS of the rule. Rule mining is computed using the apriori algorithm from arules.

Usage

1
arulesApp(dataset, bin = T, vars = 5, supp = 0.1, conf = 0.5)

Arguments

dataset

data.frame, this is the dataset that association rules will be mined from. Each row is treated as a transaction. Seems to work OK when a the S4 transactions class from arules is used, however this is not thoroughly tested.

bin

logical, TRUE will automatically discretize/bin numerical data into categorical features that can be used for association analysis.

vars

integer, how many variables to include in initial rule mining

supp

numeric, the support parameter for initializing visualization. Useful when it is known that a high support is needed to not crash computationally.

conf

numeric, the confidence parameter for initializing visualization. Similarly useful when it is known that a high confidence is needed to not crash computationally.

Value

Shiny App

See Also

arulesViz, arules

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## creating some data
n <- 10000 # of obs
d <- data.frame(
eye = sample(c('brown', 'green', 'blue', 'hazel'), n, replace=T),
gender = sample(c('male', 'female'), n, replace=T),
height = sort(sample(c('dwarf', 'short', 'average', 'above average', 'giant'), n, replace=T)),
wealth = sort(sample(c('poor', 'struggling', 'middle', 'uppermiddle', 'comfortable', 'rich', '1%', 'millionaire', 'billionaire'), n, replace=T)),
favoriteAnimal = sample(c('dog', 'cat', 'bat', 'frog', 'lion', 'cheetah', 'lion', 'walrus', 'squirrel'), n, replace=T),
numkids = abs(round(rnorm(n, 2, 1)))
)

## adding some pattern
d$numkids[d$gender=='male'] <- d$numkids[d$gender=='male'] + sample(0:3, sum(d$gender=='male'), replace=T)
d$numkids <- factor(d$numkids)

## calling Shiny App to visualize association rules
arulesApp(d)

brooksandrew/Rsenal documentation built on May 13, 2019, 7:50 a.m.