View source: R/plot.gg_partial.R
| plot.gg_partial | R Documentation |
gg_partial objectProduces ggplot2 partial dependence curves from the named list returned by
gg_partial. Continuous predictors are shown as line plots;
categorical predictors are shown as bar charts. Both panels are faceted by
variable name so multiple predictors can be compared at a glance.
## S3 method for class 'gg_partial'
plot(x, ...)
x |
A |
... |
Not currently used; reserved for future arguments. |
When only continuous or only categorical variables are present, a
single ggplot object. When both are present, a named list with
elements continuous and categorical, each a ggplot.
gg_partial, plot.gg_variable
set.seed(42)
airq <- na.omit(airquality)
rf <- randomForestSRC::rfsrc(Ozone ~ ., data = airq, ntree = 50)
pv <- randomForestSRC::plot.variable(rf, partial = TRUE, show.plots = FALSE)
pd <- gg_partial(pv)
plot(pd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.