在R中安装软件包时的依赖性错误

时间:2013-08-01 15:24:52

标签: r

您好我是win8上R. Installed R的新用户。现在我正在尝试安装软件包,但是我收到了以下错误:

install.packages("C:/Users/Owner/Downloads/pROC_1.5.4.tar.gz", repos = NULL, type = "source")
Warning in install.packages :
  InternetOpenUrl failed: 'The server name or address could not be resolved'
Warning in install.packages :
  InternetOpenUrl failed: 'The server name or address could not be resolved'
Warning in install.packages :
  unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0
Warning in install.packages :
  InternetOpenUrl failed: 'The server name or address could not be resolved'
Warning in install.packages :
  InternetOpenUrl failed: 'The server name or address could not be resolved'
Warning in install.packages :
  unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.0
Warning in install.packages :
  package ‘C:/Users/Owner/Downloads/pROC_1.5.4.tar.gz’ is not available (for R version 3.0.1)
Installing package into ‘C:/Users/Owner/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)
ERROR: dependency 'plyr' is not available for package 'pROC'
* removing 'C:/Users/Owner/Documents/R/win-library/3.0/pROC'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-30~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\Owner\Documents\R\win-library\3.0" "C:/Users/Owner/Downloads/pROC_1.5.4.tar.gz"' had status 1
Warning in install.packages :
  installation of package ‘C:/Users/Owner/Downloads/pROC_1.5.4.tar.gz’ had non-zero exit status

2 个答案:

答案 0 :(得分:0)

安装 plyr 包不会产生很大的不同,因为您的R发行版不支持 pROC 。 此外,由于您使用Rstudio,您可能会发现通过

更容易安装包
Tools>Install Packages 

然后设置

Install from:  

Repository(CRAN). 

这样您就不必手动下载它们了。 作为 pROC 的替代方案,您可以使用 ROCR 。 如果您计划使用 pROC 来计算曲线下面积,那么this也可能会引起关注,无论如何我都在离题。

答案 1 :(得分:0)

看起来直接的问题是你使用正斜杠而不是反斜杠这个事实,如果你要改变它看起来像这样:

install.packages("C:\\Users\\Owner\\Downloads\\pROC_1.5.4.tar.gz", repos = NULL, type = "source")
祝你好运!