Learn R Programming

ggRandomForests (version 1.1.2)

plot.gg_minimal_vimp: Plot a gg_minimal_vimp object for comparing the Minimal Depth and VIMP variable rankings.

Description

Plot a gg_minimal_vimp object for comparing the Minimal Depth and VIMP variable rankings.

Usage

## S3 method for class 'gg_minimal_vimp':
plot(x, modelsize, lbls, ...)

Arguments

x
gg_minimal_depth object created from a randomForestSRC::var.select object
modelsize
should the figure be restricted to a subset of the points.
lbls
a vector of alternative variable names.
...
optional arguments (not used)

Value

  • ggplot object

See Also

gg_minimal_vimp randomForestSRC::var.select

Examples

Run this code
## Examples from RFSRC package...
## ------------------------------------------------------------
## classification example
## ------------------------------------------------------------
## You can build a randomForest
# iris_rf <- rfsrc(Species ~ ., data = iris)
# iris_vs <- var.select(iris_rf)
# ... or load a cached randomForestSRC object
data(iris_vs, package="ggRandomForests")

# Get a data.frame containing minimaldepth measures
gg_dta<- gg_minimal_vimp(iris_vs)

# Plot the gg_mkinimal_depth object
plot(gg_dta)

## ------------------------------------------------------------
## Regression example
## ------------------------------------------------------------
# airq_rf <- rfsrc(Ozone ~ ., data = airquality, na.action = "na.impute")
# airq_vs <- var.select(airq_rf)
# ... or load a cached randomForestSRC object
data(airq_vs, package="ggRandomForests")

# Get a data.frame containing error rates
gg_dta<- gg_minimal_vimp(airq_vs)

# Plot the gg_error object
plot(gg_dta)

## ------------------------------------------------------------
## Survival example
## ------------------------------------------------------------
## veteran data
## randomized trial of two treatment regimens for lung cancer
# data(veteran, package = "randomForestSRC")
# veteran_rf <- rfsrc(Surv(time, status) ~ ., data = veteran, ntree = 100)
# veteran_vs <- var.select(veteran_rf)
# Load a cached randomForestSRC object
data(veteran_vs, package="ggRandomForests")

gg_dta <- gg_minimal_vimp(veteran_vs)
plot(gg_dta)

Run the code above in your browser using DataLab