1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
\name{varImpPlot}
\alias{varImpPlot}
\title{Variable Importance Plot}
\description{
Dotchart of variable importance as measured by a Random Forest
}
\usage{
varImpPlot(x, sort=TRUE, n.var=min(30, nrow(x$importance)),
type=NULL, class=NULL, scale=TRUE,
main=deparse(substitute(x)), ...)
}
\arguments{
\item{x}{An object of class \code{randomForest}.}
\item{sort}{Should the variables be sorted in decreasing order of
importance?}
\item{n.var}{How many variables to show? (Ignored if
\code{sort=FALSE}.)}
\item{type, class, scale}{arguments to be passed on to
\code{\link{importance}}}
\item{main}{plot title.}
\item{...}{Other graphical parameters to be passed on to
\code{\link{dotchart}}.}
}
\value{
Invisibly, the importance of the variables that were plotted.
}
\seealso{
\code{\link{randomForest}}, \code{\link{importance}}
}
\examples{
set.seed(4543)
data(mtcars)
mtcars.rf <- randomForest(mpg ~ ., data=mtcars, ntree=1000, keep.forest=FALSE,
importance=TRUE)
varImpPlot(mtcars.rf)
}
\author{Andy Liaw \email{andy_liaw@merck.com}}
\keyword{regression}
\keyword{classif}
\keyword{tree}
|