Skip to contents

Draws the tree as an interactive 'plotly' htmlwidget with zoom, pan and hover information (reaching rule, class distribution and split details for each node). The widget can be embedded directly in R Markdown documents or saved as HTML.

Usage

chaid_plotly(fit, palette = NULL, label_len = 20, ...)

Arguments

fit

A fitted "chaid" object returned by chaid().

palette

Vector of class colours for categorical responses (default grDevices::hcl.colors(n, "Dark 3"), matching plot.chaid()).

label_len

Maximum number of characters for edge (split group) labels.

...

Ignored.

Value

A 'plotly' htmlwidget.

Examples

fit <- chaid(Species ~ ., data = iris,
             control = chaid_control(min_parent = 30, min_child = 10))
chaid_plotly(fit)