R Windows:安装软件包“ rvest”(和其他几个软件包)时出错

时间:2019-08-19 23:32:19

标签: r package

我正在尝试在Visual Studio 2017的R的全新安装中安装软件包。将安装一些软件包,但有些会给我同样的错误。一个例子是“ rvest”包。当我尝试install.packages(“ rvest”)

  

install.packages(“ rvest”)

Installing package into ‘C:/Users/Sean/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
      binary source needs_compilation
rvest  0.3.2  0.3.3             FALSE

installing the source package ‘rvest’

trying URL 'https://mran.microsoft.com/snapshot/2019-04-15/src/contrib/rvest_0.3.3.tar.gz'
Content type 'application/octet-stream' length 1631059 bytes (1.6 MB)
downloaded 1.6 MB

In R CMD INSTALL

The downloaded source packages are in
    ‘C:\Users\Sean\AppData\Local\Temp\RtmpmuXBs1\downloaded_packages’
Warning message:
In utils::install.packages(...) :
  installation of package ‘rvest’ had non-zero exit status

“ rcmdcheck”中也会发生这种情况:

> install.packages("rcmdcheck")
Installing package into ‘C:/Users/Sean/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
          binary source needs_compilation
rcmdcheck  1.3.1  1.3.2             FALSE

installing the source package ‘rcmdcheck’

trying URL 'https://mran.microsoft.com/snapshot/2019-04-15/src/contrib/rcmdcheck_1.3.2.tar.gz'
Content type 'application/octet-stream' length 1408582 bytes (1.3 MB)
downloaded 1.3 MB

In R CMD INSTALL

The downloaded source packages are in
    ‘C:\Users\Sean\AppData\Local\Temp\RtmpmuXBs1\downloaded_packages’
Warning message:
In utils::install.packages(...) :
  installation of package ‘rcmdcheck’ had non-zero exit status

我的sessionInfo()显示:

> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252 LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] FSVRegimeDetection_0.0.0.9000  aTSA_3.1.2                     autoimage_2.0                  FSVPreselection_0.0.0.9000     FSVTradingRules_0.0.0.9000     FinancialInstrument_1.3.1      quantmod_0.4-14               
 [8] FSVIndicators_0.0.0.9000       dlm_1.1-5                      PerformanceAnalytics_1.5.2     TTR_0.23-4                     FSVPositionSizing_0.0.0.9000   FSVDataCheck_0.0.0.9000        xts_0.11-2                    
[15] zoo_1.8-5                      FSVLibraryUtilities_0.0.0.9000 roxygen2_6.1.1                 usethis_1.5.0                  devtools_2.0.2                 ldhmm_0.4.5                    RevoUtils_11.0.3              
[22] RevoUtilsMath_11.0.0          

loaded via a namespace (and not attached):
 [1] ecd_0.9.1              pkgload_1.0.2          bit64_0.9-7            moments_0.14           assertthat_0.2.1       rtvs_1.0.0.0           RcppFaddeeva_0.1.0     blob_1.1.1             yaml_2.2.0             remotes_2.0.4         
[11] sessioninfo_1.1.1      numDeriv_2016.8-1      pillar_1.3.1           RSQLite_2.1.1          backports_1.1.4        lattice_0.20-38        glue_1.3.1             quadprog_1.5-5         digest_0.6.18          colorspace_1.4-1      
[21] plyr_1.8.4             pkgconfig_2.0.2        purrr_0.3.2            xtable_1.8-3           scales_1.0.0           processx_3.3.0         tibble_2.1.1           gmp_0.5-13.5           ggplot2_3.1.1          withr_2.1.2           
[31] lazyeval_0.2.2         Rmpfr_0.7-2            cli_1.1.0              magrittr_1.5           crayon_1.3.4           memoise_1.1.0          ps_1.3.0               fs_1.2.7               gsl_2.1-6              xml2_1.2.0            
[41] pkgbuild_1.0.3         tools_3.5.3            prettyunits_1.0.2      stringr_1.4.0          munsell_0.5.0          stabledist_0.7-1       FSVBackTest_0.0.0.9000 callr_3.2.0            compiler_3.5.3         rlang_0.3.4           
[51] grid_3.5.3             rstudioapi_0.10        testthat_2.0.1         gtable_0.3.0           curl_3.3               DBI_1.0.0              polynom_1.4-0          R6_2.4.0               gridExtra_2.3          knitr_1.22            
[61] dplyr_0.8.0.1          optimx_2018-7.10       bit_1.1-14             commonmark_1.7         rprojroot_1.3-2        desc_1.2.0             stringi_1.4.3          parallel_3.5.3         Rcpp_1.0.1             tidyselect_0.2.5      
[71] xfun_0.6 

任何帮助追踪此问题根源的人将不胜感激!

2 个答案:

答案 0 :(得分:0)

您可以尝试使用 devtools 安装软件包的github版本,如下所示:

install.packages("devtools")
devtools::install_github("tidyverse/rvest")

答案 1 :(得分:0)

我能够使用

加载这些软件包
type = "binary"
install.packages()方法调用中的

参数。即:

install.packages("rvest", type = "binary")