如何分辨CRAN自动安装软件包的依赖?(How to tell CRAN to install pa

2019-07-17 20:43发布

我开发R A包,当我检查,并在我的本地计算机建立它,它工作正常。 但是,当我在CRAN尝试了,我得到一个软件包的依赖关系错误。 我的包依赖于其他包的两个功能。

如果我列出了下其他包description使用Dependsimports ,它会自动与新包安装? 或者我需要显式调用功能install.packages("packagename")的作用下,我已经使用了其他包。 如果这一切都是错的,什么是解决软件包依赖关系的最佳途径R序传递R CMD checkbuild测试并提交给CRAN?

谢谢。

Answer 1:

在您自己的系统,尝试

install.packages("foo", dependencies=...)

dependencies=参数记录为

dependencies: logical indicating to also install uninstalled packages
      which these packages depend on/link to/import/suggest (and so
      on recursively).  Not used if ‘repos = NULL’.  Can also be a
      character vector, a subset of ‘c("Depends", "Imports",
      "LinkingTo", "Suggests", "Enhances")’.

      Only supported if ‘lib’ is of length one (or missing), so it
      is unambiguous where to install the dependent packages.  If
      this is not the case it is ignored, with a warning.

      The default, ‘NA’, means ‘c("Depends", "Imports",
      "LinkingTo")’.

      ‘TRUE’ means (as from R 2.15.0) to use ‘c("Depends",
      "Imports", "LinkingTo", "Suggests")’ for ‘pkgs’ and
      ‘c("Depends", "Imports", "LinkingTo")’ for added
      dependencies: this installs all the packages needed to run
      ‘pkgs’, their examples, tests and vignettes (if the package
      author specified them correctly).

所以你可能需要一个值TRUE

在你的包,列表需要什么Depends:见写作R附加手册,该手册是对这个很清楚。



Answer 2:

另一种可能性是选择安装依赖复选框在R软件包安装程序,在右下角:



文章来源: How to tell CRAN to install package dependencies automatically?
标签: r cran r-forge