我在R开发一个包,当我检查和建立在我的本地计算机它正常工作。但是当我试图在CRAN,我得到一个软件包依赖性错误。我的包取决于其他包的两个函数。
如果我使用Depends或导入来列出描述下的其他包,它会自动与新包一起安装吗?或者我需要显式调用函数install.packages(“packagename”)在我使用其他软件包的函数下。如果这一切都是错误的,什么是最好的方式来解决R依赖包,以通过R CMD检查和构建测试并提交到CRAN?
谢谢。
在你自己的系统上,试试
原文链接:https://www.f2er.com/javaschema/282517.htmlinstall.packages("foo",dependencies=...)
with 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","LinkingTo")’. ‘TRUE’ means (as from R 2.15.0) to use ‘c("Depends","Suggests")’ for ‘pkgs’ and ‘c("Depends","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。
在你的包中,列出需要在依赖:,请参阅
Writing R Extensions手册这是很清楚这一点。