我怎样才能改变由x
产生的情节的限制varImpPlot
randomForest
?
如果我尝试
set.seed(4543)
data(mtcars)
mtcars.rf <- randomForest(mpg ~ ., data=mtcars, ntree=1000, keep.forest=FALSE,
importance=TRUE)
varImpPlot(mtcars.rf, scale=FALSE, type=1, xlim=c(0,15))
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
dotchart(imp[ord, i], xlab = colnames(imp)[i], ylab = "", main = if (nmeas == : 形式参数“xlim”与多个实际参数匹配)中出现错误”。
我认为这是因为varImpPlot
定义了它自己的x
限制,但是如果我想自己设置 x 限制(也许是为了图之间的一致性),我该如何解决这个问题?