varImpPlot {randomForest} | R Documentation |
Dotchart of variable importance as measured by a Random Forest
varImpPlot(x, sort=TRUE, n.var=min(30, if(is.null(dim(x$importance))) length(x$importance) else nrow(x$importance)), class = NULL, scale=TRUE, xlab="Importance", ylab="", main=deparse(substitute(x)), ...)
x |
An object of class randomForest . |
sort |
Should the variables be sorted in decreasing order of importance? |
n.var |
How many variables to show? (Ignored if
sort=FALSE .) |
class |
For classification data, an integer or string indicating the class for which variable importance is seeked. |
scale |
For permutation-based measures, should the measures be divided by their ``standard errors''? |
xlab |
label for the x-axis. |
ylab |
label for the y-axis. |
main |
plot title. |
... |
Other graphical parameters. |
Invisibly, the importance of the variables.
Andy Liaw andy_liaw@merck.com
set.seed(4543) data(mtcars) mtcars.rf <- randomForest(mpg ~ ., data=mtcars, ntree=1000, keep.forest=FALSE, importance=TRUE) varImpPlot(mtcars.rf)