簡體   English   中英

R找不到包

[英]R cannot find package

在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'

沒有提示錯誤。 有誰知道如何解決或調試此問題?

感謝所有評論,我已經解決了這個問題。

這是lib路徑問題,我要安裝的路徑不在.libPaths()中。

我通過將路徑添加到.libPaths()中來解決它

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

然后,我的代碼將在添加的路徑下找到ra​​ndomForest包。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM