Learn R Programming

pkggraph (version 0.3.0)

get_dependencies: Get (reverse) dependencies of a set of packages

Description

Get (reverse) dependencies of a set of packages till a certain depth(level) for a set of dependency types (relation).

Usage

get_dependencies(
  packages,
  level = 1L,
  relation = c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances"),
  strict = FALSE,
  ignore = c("datasets", "utils", "grDevices", "graphics", "stats", "methods"),
  reverse = FALSE
)

Value

(dataframe) with three columns: pkg_1, relation and pkg_2

Arguments

packages

(chr) Package names

level

(count(1)) Depth of recursive dependency

relation

(chr) Types of relations. Must be a subset of c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances")

strict

(flag[T]) Whether to consider all packages (alternately only 'relation' specific packages) when computing dependencies for the next level.

ignore

(chr) package names to ignore.

reverse

(flag[F]) Whether to get reverse dependencies.

See Also

get_neighborhood

Examples

Run this code
if (FALSE) {
init()
get_dependencies("mlr3") |>
get_dependencies("mlr3", level = 2)
get_dependencies("mlr3", level = 2, reverse = TRUE)
get_dependencies("mlr3", level = 2, relation = "Imports")
# setting strict to TRUE to only consider 'Imports' of the previous level
get_dependencies("mlr3",
                 level    = 2,
                 relation = "Imports",
                 strict   = TRUE
                 )
}

Run the code above in your browser using DataLab