package_dependencies(packages = NULL, db = NULL, which = "strong", recursive = FALSE, reverse = FALSE, verbose = getOption("verbose"))
packages | a character vector of the names of packages for which dependency information is needed. If NULL, the default, the "Packages" column of the db argument is used. |
db | a character matrix resembling the output of available.packages or installed.packages. It must have a column named "Package". Typically, it has columns called "Depends", "Imports", "Linkingto", and "Suggests" that contain comma-separated lists of package names, possibly followed by package version restrictions such as "(>=3.4)". If NULL (the default), the result of available.packages() is used. |
which |
a set of names of columns of db that contain comma-separated lists
of columns. All packages named in these columns are considered to be
required by the package in the "Package" column.
Some "nicknames" for commonly used sets of columns may also be used. "strong" means c("Depends", "Imports", "LinkingTo"), "most" adds "Suggests" to that, and "all" also adds "Enhances" to the set. |
recursive |
|
reverse |
a logical value.
|
verbose | a logical value. This argument is currently ignored. |
available <- rbind( c(Package="A", Depends=NA, Imports="B, E", LinkingTo=NA, Suggests=NA), c(Package="B", Depends=NA, Imports=NA, LinkingTo="C", Suggests=NA), c(Package="C", Depends=NA, Imports="D", LinkingTo=NA, Suggests=NA), c(Package="D", Depends=NA, Imports=NA, LinkingTo=NA, Suggests="E"), c(Package="E", Depends=NA, Imports=NA, LinkingTo=NA, Suggest=NA)) tools::package_dependencies(c("A", "B"), db = available) tools::package_dependencies(c("A", "B"), db = available, which="most", recursive="strong") tools::package_dependencies(c("A", "B"), db = available, recursive = TRUE) tools::package_dependencies("D", db = available, reverse = TRUE, recursive = FALSE) tools::package_dependencies("D", db = available, reverse = TRUE, recursive = TRUE)