简体   繁体   中英

R cannot find package

On REHL5.7, after I used install.packages("randomForest") in R command lines, I get:

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'

No error is prompted. Does anyone know how to fix or debug this problem?

Thanks to all comments, I have solved the problem.

It is the lib path problems, the path I am installing to is not in .libPaths().

I solved it by adding the path into .libPaths() by

.libPaths( c(.libPaths(), "/home/admin/user/data"))

and then, my code will find the randomForest package under the added path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM