Plot a gg_vimp
object, extracted variable importance of a rfsrc
object
Source: R/plot.gg_vimp.R
plot.gg_vimp.Rd
Usage
# S3 method for class 'gg_vimp'
plot(x, relative, lbls, ...)
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.
Examples
## ------------------------------------------------------------
## classification example
## ------------------------------------------------------------
## -------- iris data
rfsrc_iris <- rfsrc(Species ~ ., data = iris)
gg_dta <- gg_vimp(rfsrc_iris)
#> Warning: rfsrc object does not contain VIMP information. Calculating...
plot(gg_dta)
#> Warning: All aesthetics have length 1, but the data has 16 rows.
#> ℹ Please consider using `annotate()` or provide this layer with data containing
#> a single row.
## ------------------------------------------------------------
## regression example
## ------------------------------------------------------------
## -------- air quality data
rfsrc_airq <- rfsrc(Ozone ~ ., airquality)
gg_dta <- gg_vimp(rfsrc_airq)
#> Warning: rfsrc object does not contain VIMP information. Calculating...
plot(gg_dta)
#> Warning: All aesthetics have length 1, but the data has 5 rows.
#> ℹ Please consider using `annotate()` or provide this layer with data containing
#> a single row.