plot.rxDTree: Plots rxDTree object.

Description Usage Arguments Examples

Description

Plots rxDTree object.

Usage

1
2
3
## S3 method for class 'rxDTree'
plot(x, text = TRUE, plotArgs = NULL, textArgs = NULL,
  ...)

Arguments

x

rxDTree object

text

If TRUE, adds text labels

plotArgs

Named list, passed to plot.rpart

textArgs

Names list, passed to text.rpart

...

Not used. Required for consistency with other plot methods.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
### rxDTree examples
library("RevoScaleR")
library("ggplot2")
frm <- formulaExpand(price ~ ., data=diamonds)
fit <- rxDTree(frm, diamonds, maxDepth=3)
par(mar=c(0.5, 0.5, 2, 0.5))
plot(fit)
plot(fit, textArgs=list(col="blue", cex=0.7))
plot(fit, textArgs=list(col="blue", cex=0.7), plotArgs=list(main="Forest 1"))


if(exists("rxDForest")){
  fit <- rxDForest(frm, diamonds, maxDepth=3)
  forest <- fit$forest
  par(mar=c(0.5, 0.5, 2, 0.5))
  plot(forest[[1]])
  plot(forest[[1]], textArgs=list(col="blue", cex=0.7))
  plot(forest[[1]], textArgs=list(col="blue", cex=0.7), plotArgs=list(main="Forest 1"))
  plot(forest[[2]], textArgs=list(col="blue", cex=0.7), plotArgs=list(main="Forest 2"))
}

RevoEnhancements/RevoEnhancements documentation built on May 9, 2019, 9:46 a.m.