rfPermute (version 2.1.81)

plotImpVarDist: Plot Important Variable Distribution

Description

Plot distribution of predictor variables on classes sorted by order of importance in model.

Usage

plotImpVarDist(rf, df, class.col, max.vars = 16, plot = TRUE)

Arguments

rf

an object inheriting from randomForest.

df

data.frame with predictors in rf model.

class.col

response column name in df.

max.vars

number of variables to plot (from most important to least).

plot

display the plot?

Value

the ggplot2 object is invisibly returned.

Examples

Run this code
# NOT RUN {
data(mtcars)
df <- mtcars
df$am <- factor(df$am)

rf <- randomForest(am ~ ., df, importance = TRUE)
plotImpVarDist(rf, df, "am")

# }

Run the code above in your browser using DataLab