2015-10-10 92 views
0

我試圖安裝一個R包,它是我從開發人員直接從* .tar.gz格式獲得的。但命令:在Linux系統中安裝r依賴關係?

install.packages("~/Path/to/the/file/package.tar.gz", repos = NULL, type = "source") 

Installing package into ‘/home/XXX/R/x86_64-pc-linux-gnu-library/3.2’ 
(as ‘lib’ is unspecified) 
ERROR: dependencies ‘NetIndices’, ‘limSolve’, ‘diagram’ are not available for package ‘package’ 
* removing ‘/home/XXX/R/x86_64-pc-linux-gnu-library/3.2/package’ 
Warning in install.packages : 
installation of package ‘/home/path/to/the/file/Package/package.tar.gz’ had non-zero exit status 

我怎樣才能獲得依賴隨程序包?我曾嘗試在install.packages中使用dependencies = TRUE來無濟於事。

回答

0

由於您將repos設置爲NULL依賴關係無法解析。嘗試先安裝依賴項:

install.packages(
    c("NetIndices", "limSolve", "diagram"), 
    repos="https://cran.rstudio.com" # or other CRAN mirror 
) 

然後安裝源碼包。

0

如果你正在安裝一個tar.gz,你必須自己安裝它們,或者你可以試試Dirk的懶小子「小r」,它不是一個R包,而是一個Linux工具,它提供了一個安裝包工具這就是你想要的。有Debian和Ubuntu軟件包。