Learn R Programming

edarf (version 1.1.0)

plot_imp: Plot variable importance from random forests

Description

Plot variable importance from random forests

Usage

plot_imp(imp, sort = "decreasing")

Arguments

imp
object of class c("importance", "data.frame") as returned by variable_importance
sort
character indicating if sorting of the output is to be done. can be "ascending", or "descending."

Value

a ggplot2 object

Examples

Run this code
library(randomForest)
data(iris)
fit <- randomForest(Species ~ ., iris)
imp <- variable_importance(fit, nperm = 2, data = iris)
plot_imp(imp)

Run the code above in your browser using DataLab