R 3.1.2 中的 Gain 包安装错误

Gain Package Installation error in R 3.1.2

我正在尝试在 R Studio 版本 3.1.2 中安装 Gains 包,如下所示: install.packages("gains")

出现以下警告: InternetOpenUrl 失败:'The server name or address could not be resolved' install.packages 中的警告:无法访问存储库 http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.1 的索引 install.packages 中的警告:包“增益”不可用(对于 R 版本 3.1.2)

有人知道我该如何解决这个问题吗?

谢谢!

我认为问题在于您的损坏、不完整或不正确的 R 环境。只需发出默认命令,我就可以毫无问题地安装该软件包:

> install.packages("gains")
Installing package into ‘C:/Users/Alex/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/gains_1.1.zip'
Content type 'application/zip' length 35802 bytes (34 Kb)
opened URL
downloaded 34 Kb

package ‘gains’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\Alex\AppData\Local\Temp\RtmpSSRths\downloaded_packages
> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)

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

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

loaded via a namespace (and not attached):
[1] tools_3.1.1

作为问题的快速解决方案,我建议明确指定 CRAN 镜像:

install.packages("gains", repos = "http://cran.rstudio.com")