package_dependencies

0th

Percentile

Computations on the Dependency Hierarchy of Packages

Find (recursively) dependencies or reverse dependencies of packages.

Keywords
utilities
Usage
package_dependencies(packages = NULL, db = NULL,
        which = c("Depends", "Imports", "LinkingTo"),
	recursive = FALSE, reverse = FALSE, verbose = getOption("verbose"))
Arguments
packages
a character vector of package names.
db
character matrix as from available.packages() (with the default NULL the results of this call) or data frame variants thereof. Alternatively, a package database like the one available from https://cran.r-project.org/web/packages/packages.rds.
which
a character vector listing the types of dependencies, a subset of c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances"). Character string "all" is shorthand for that vector, character string "most" for the same vector without "Enhances".
recursive
logical: should (reverse) dependencies of (reverse) dependencies (and so on) be included?
reverse
logical: if FALSE (default), regular dependencies are calculated, otherwise reverse dependencies.
verbose
logical indicating if output should monitor the package search cycles.
Value

Named list with one element for each package in argument packages, each consists of a character vector naming the (recursive) (reverse) dependencies of that package. For given packages which are not found in the db, NULL entries are returned, as opposed to character(0) entries which indicate no dependencies.

See Also

dependsOnPkgs, and package.dependencies for checking dependencies.

Aliases
  • package_dependencies
Examples
library(tools) ## Not run: ------------------------------------ # pdb <- available.packages() # deps <- package_dependencies(packages = "MASS", pdb, # which = c("Depends", "Imports", "LinkingTo", "Suggests"), # recursive = TRUE, reverse = TRUE) # length(deps$MASS) ## ---------------------------------------------
Documentation reproduced from package tools, version 3.3.3, License: Part of R 3.3.3

Community examples

Looks like there are no examples yet.