Learn R Programming

abcrf (version 1.9)

variableImpPlot: Variable importance plot from a random forest

Description

variableImpPlot provides a dotchart of variable importance as measured by ranger with the argument importance='impurity'.

Usage

variableImpPlot(object, 
n.var=min(30, length(object$model.rf$variable.importance)),
xlim=NULL, main=NULL)

Value

Invisibly, the importance of the variables that were plotted.

Arguments

object

an abcrf or regAbcrf object.

n.var

number of variables in the variable importance representation.

xlim

range of the abscissa.

main

an overall title for the variable importance plot.

See Also

abcrf, plot.abcrf, plot.regAbcrf

Examples

Run this code
data(snp)
modindex <- snp$modindex[1:500]
sumsta <- snp$sumsta[1:500,]
data1 <- data.frame(modindex, sumsta)
model.rf <- abcrf(modindex~., data1, ntree=100)
variableImpPlot(model.rf)

Run the code above in your browser using DataLab