Learn R Programming

pkggraph (version 0.3.0)

get_neighborhood: Obtain dependencies and reverse dependencies of a set of packages

Description

Obtain dependencies and reverse dependencies of packages till a given depth (level) for a set of dependency types (relation).

Usage

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

Value

(dataframe) 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.

See Also

get_dependencies

Examples

Run this code
if (FALSE) {
init()
# explore first level dependencies
get_neighborhood("mlr3")

# explore second level dependencies
get_neighborhood("caret", level = 2)

# explore first level dependencies of multiple packages
# and consider second level dependencies
get_neighborhood(c("caret", "mlr"))

# get 'imports' specific neighborhood of 'mlr'
get_neighborhood("mlr", relation = "Imports")
}

Run the code above in your browser using DataLab