Learn R Programming

ggRandomForests (version 1.0.0)

plot.gg_vimp: Plot a gg_vimp object, extracted variable importance of a randomForestSRC::rfsrc object

Description

Plot a gg_vimp object, extracted variable importance of a randomForestSRC::rfsrc object

Usage

## S3 method for class 'gg_vimp':
plot(x, n_var, ...)

Arguments

x
gg_vimp object created from a randomForestSRC::rfsrc object
n_var
restrict the plot to only nvar variable importance measures
...
optional arguments passed to gg_vimp if necessary

Value

  • ggplot object

References

Breiman L. (2001). Random forests, Machine Learning, 45:5-32.

Ishwaran H. and Kogalur U.B. (2007). Random survival forests for R, Rnews, 7(2):25-31.

Ishwaran H. and Kogalur U.B. (2013). Random Forests for Survival, Regression and Classification (RF-SRC), R package version 1.4.

See Also

gg_vimp

Examples

Run this code
#' ## ------------------------------------------------------------
## classification example
## ------------------------------------------------------------
# iris_rf <- rfsrc(Species ~ ., data = iris)
data(iris_rf, package="ggRandomForests")
ggrf <- gg_vimp(iris_rf)
plot(ggrf)

## ------------------------------------------------------------
## regression example
## ------------------------------------------------------------

# airq.obj <- rfsrc(Ozone ~ ., airquality)
data(airq_rf, package="ggRandomForests")
ggrf <- gg_vimp(airq_rf)
plot(ggrf)

## ------------------------------------------------------------
## survival example
## ------------------------------------------------------------
data(veteran_rf, package="ggRandomForests")
ggrf <- gg_vimp(veteran_rf)
plot(ggrf)

Run the code above in your browser using DataLab