在 R 中安装测试套件中使用的所有包?

Install all packages used in testing suite in R?

我正在尝试向 library(broom) 提交 PR,它依赖于测试一堆不同的库。有没有一种快速的方法来安装测试套件中使用的所有软件包?

我们可以指定具体需要安装的依赖如下(可以只指定Suggests 例如:

install.packages("broom", dependencies = c("Suggests","Enhances",
                                           "Depends"))

有关可用选项的更多信息,请参见 install.packages 的帮助页面。对于这个问题,相关资料是:

dependencies logical indicating whether 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.