在REHL5.7上,在R命令行中使用install.packages("randomForest")
后,我得到:
installing to randomForest/libs
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
converting help for package 'randomForest'
finding HTML links ... done
MDSplot html
classCenter html
combine html
getTree html
grow html
importance html
imports85 html
margin html
na.roughfix html
outlier html
partialPlot html
plot.randomForest html
predict.randomForest html
randomForest html
rfImpute html
rfNews html
rfcv html
treesize html
tuneRF html
varImpPlot html
varUsed html
** building package indices
** testing if installed package can be loaded
* DONE (randomForest)
Error in library(randomForest) :
there is no package called 'randomForest'
未提示错误。有谁知道如何修复或调试这个问题?
答案 0 :(得分:1)
感谢所有评论,我已经解决了这个问题。
这是lib路径问题,我安装的路径不在.libPaths()中。
我通过
将路径添加到.libPaths()中解决了这个问题.libPaths( c(.libPaths(), "/home/admin/user/data"))
然后,我的代码将在添加的路径下找到randomForest包。