This function will return all package dependencies for any given package, including backwards dependency for all. The function mainly prints out the dependency tree in the console, but also returns all packages required for build (uniquely).

get_dependency_tree(
  package,
  i = 1,
  type = c("Depends", "Imports"),
  repos = getOption("repos"),
  verbose = TRUE,
  ...
)

Arguments

package

name of package. character.

i

integer. Used in recursive call to package dependency retrieval.

type

Character vector, a subset of c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances")

repos

character vector. Addresses of CRAN mirror(s)

verbose

logical. If function should be talkative.

...

additional arguments to functions available.packages

Value

character vector of unique packages