Description Usage Arguments Examples
Plots rxDTree object.
1 2 3 |
x |
rxDTree object |
text |
If TRUE, adds text labels |
plotArgs |
Named list, passed to
|
textArgs |
Names list, passed to
|
... |
Not used. Required for consistency with other plot methods. |
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"))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.