如何让CRAN自动安装软件包依赖关系?

我在R中开发一个包,当我在本地计算机中检查并构建它时,它可以正常工作。 但是当我在CRAN中尝试它时,出现软件包依赖性错误。 我的软件包取决于其他软件包的两个功能。

如果我列出了下其他包description使用Dependsimports ,它会自动与新包安装? 或者我需要在使用其他包的函数下显式调用函数install.packages("packagename") 。 如果这一切都是错误的,那么解决R包依赖关系的最好方法是通过R CMD checkbuild测试并提交给CRAN?

谢谢。


在你自己的系统上,试试

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:需要的内容Depends: ,请参阅Writing R Extensions手册,该手册非常清晰。


另一种可能性是选择安装依赖关系复选框在右下角的R安装程序中:

在这里输入图像描述

链接地址: http://www.djcxy.com/p/60061.html

上一篇: How to tell CRAN to install package dependencies automatically?

下一篇: FTP "550 Access is denied" Error