2015-10-10 55 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软件包。