plot_dt {lazy.tree} | R Documentation |
Plot Decision Tree
plot_dt(
obj,
title = "Decision Tree",
type = 1,
xname = NULL,
col_leaf = NULL,
pch = 1,
lwd = 4,
cex = 0.7
)
obj |
The output of DecTree or list of nodes. |
title |
The title string |
type |
= 2 for numeric criterion |
xname |
Vector consisting of the names of the regressors. |
col_leaf |
Color names for the leaf nodes, or NULL |
pch |
point type of legend |
lwd |
point size of legend |
cex |
character size of legend |
This function requires igraph
package.
A dataframe consisting of
nodename = node name nodenum = leaf node name varnum = variable name Col = color of the nodes#'
## Not run:
library(igraph)
Xc <- as.data.frame(cbind(square$c1,square$c2))
res1 <- DecTree( square$Class4, Xc, maxdepth=3, print=1 )
plot_dt( res1, title="square"
, col_leaf=c("red","darkgreen","orange","lightblue") )
plot_dt( res1$node, title="square", xname=res1$xname )
## End(Not run)