我试图以* .tar.gz格式直接从开发者处安装我收到的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 :(得分:0)
由于您将repos
设置为NULL
,因此无法解析依赖关系。首先尝试安装依赖项:
install.packages(
c("NetIndices", "limSolve", "diagram"),
repos="https://cran.rstudio.com" # or other CRAN mirror
)
然后安装源包。
答案 1 :(得分:0)
如果您要安装tar.gz,您必须自己安装,或者您可以尝试使用Dirk< s;更小的r"这不是一个R包,而是一个Linux工具,它提供了一个安装包工具,可以满足您的需求。有Debian和Ubuntu软件包。