简体   繁体   English

无法在R中安装插入符号包

[英]Can't install caret package in R

I have tried multiple ways to install the caret package in R. The error message that I receive is as follows: 我已经尝试了多种方法在R中安装caret包。我收到的错误消息如下:

Error: package or namespace load failed for 'caret' in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called 'dimRed' 错误:loadNamespace中的'caret'的包或命名空间加载失败(j < - i [[1L]],c(lib.loc,.libPaths()),versionCheck = vI [[j]]):没有包叫'dimRed'

When I try to install dimRed , I get the following message: 当我尝试安装dimRed ,收到以下消息:

Installing package into ‘C:/Users/Thomas/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
  dependency ‘Biobase’ is not available

  There is a binary version available but the source version is later:
   binary source needs_compilation
dimRed  0.1.0  0.2.1             FALSE

installing the source package ‘dimRed’

trying URL 'https://cran.rstudio.com/src/contrib/dimRed_0.2.1.tar.gz'
Content type 'application/x-gzip' length 363025 bytes (354 KB)
downloaded 354 KB

ERROR: dependency 'Biobase' is not available for package 'dimRed' * removing 'C:/Users/Thomas/Documents/R/win-library/3.4/dimRed' In R CMD INSTALL Warning in install.packages : running command '"C:/PROGRA~1/R/R-34~1.4/bin/x64/R" CMD INSTALL -l "C:\\Users\\Thomas\\Documents\\R\\win-library\\3.4" C:\\Users\\Thomas\\AppData\\Local\\Temp\\RtmpqKhsKn/downloaded_packages/dimRed_0.2.1.tar.gz' had status 1 Warning in install.packages : installation of package 'dimRed' had non-zero exit status 错误:依赖'Biobase'不适用于包'dimRed'*删除'C:/Users/Thomas/Documents/R/win-library/3.4/dimRed'在R CMD INSTALL中警告install.packages:running command'“ C:/PROGRA~1/R/R-34~1.4/bin/x64/R“CMD INSTALL -l”C:\\ Users \\ Thomas \\ Documents \\ R \\ win-library \\ 3.4“C:\\ Users \\ Thomas \\ appData \\ Local \\ Temp \\ RtmpqKhsKn / downloaded_pa​​ckages / dimRed_0.2.1.tar.gz'在install.packages中有状态1警告:软件包'dimRed'的安装具有非零退出状态

The downloaded source packages are in 'C:\\Users\\Thomas\\AppData\\Local\\Temp\\RtmpqKhsKn\\downloaded_packages' 下载的源包位于'C:\\ Users \\ Thomas \\ AppData \\ Local \\ Temp \\ RtmpqKhsKn \\ downloaded_pa​​ckages'中

Per previous posts, I have updated RStudio. 根据以前的帖子,我更新了RStudio。 I have attempted an install from install_url. 我尝试从install_url安装。

Any suggestions are welcome. 欢迎任何建议。

I was able to figure this out. 我能够弄清楚这一点。 Simply typing install.packages won't work. 只需输入install.packages就行了。 In order to install Biobase, you have to run the following code in R console: 要安装Biobase,您必须在R控制台中运行以下代码:

if (!requireNamespace("BiocManager", quietly = TRUE))
  install.packages("BiocManager")
BiocManager::install("Biobase", version = "3.8")

More info: https://bioconductor.org/packages/release/bioc/html/Biobase.html 更多信息: https//bioconductor.org/packages/release/bioc/html/Biobase.html

Once this step is done, I installed caret again using 完成此步骤后,我再次使用插入符号

install.packages("caret",dependencies = T)

And then it worked. 然后它奏效了。

Warning ... 警告 ...

install.packages("BiocManager")

This only works if your R version is >= 3.5.0 仅当您的R版本> = 3.5.0时才有效

for info I've the same problem under a Centos and a Windows. 对于信息我在Centos和Windows下遇到了同样的问题。 issue solved on the windows with 3.5.1 R version. 在3.5.1 R版本的Windows上解决了问题。 Not yet solved on the centOS (3.4.2) 在centOS上尚未解决(3.4.2)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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