如何安装插入符号包。尝试install.packages(“插入符”)但出现错误

时间:2019-07-24 10:32:34

标签: r caret install.packages

OPTION3出现以下错误之后:

install.packages("caret")

我已经尝试并安装了“ rlang”软件包。它依赖于“收据”包,因此也再次下载了该包...

在安装此消息后获取此消息。

Installing package into ‘...../R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘rlang’, ‘recipes’


  There are binary versions available but the source versions are later:
        binary source needs_compilation
rlang    0.3.4  0.4.0              TRUE
recipes  0.1.5  0.1.6             FALSE
caret   6.0-81 6.0-84              TRUE

  Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/rlang_0.3.4.zip'
Content type 'application/zip' length 1080437 bytes (1.0 MB)
downloaded 1.0 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/caret_6.0-81.zip'
Content type 'application/zip' length 5392174 bytes (5.1 MB)
downloaded 5.1 MB

package ‘rlang’ successfully unpacked and MD5 sums checked
Warning in install.packages :
  cannot remove prior installation of package ‘rlang’
package ‘caret’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    .........\Temp\RtmpkJG4l1\downloaded_packages
installing the source package ‘recipes’

trying URL 'https://cran.rstudio.com/src/contrib/recipes_0.1.6.tar.gz'
Content type 'application/x-gzip' length 968331 bytes (945 KB)
downloaded 945 KB

ERROR: dependency 'rlang' is not available for package 'recipes'
* removing 'C:/Users/PBiradarP/Documents/R/win-library/3.4/recipes'
In R CMD INSTALL
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-34~1.4/bin/x64/R" CMD INSTALL -l "......\R\win-library\3.4" 
...../Temp\RtmpkJG4l1/downloaded_packages/recipes_0.1.6.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘recipes’ had non-zero exit status

我需要加载插入符号软件包才能安装。

1 个答案:

答案 0 :(得分:0)

如果您使用的是Windows,请尝试以下操作:

将您的库添加到libpaths中;参见this answer。之后,尝试安装软件包;参见this answer

install.packages("caret", dependencies=TRUE, type="win.binary")