neighborhood_graph: neighborhood_graph

Description Usage Arguments Value Author(s) See Also Examples

Description

Obtain a network or igraph graph object of dependencies and reverse dependencies of packages at a given depth of recursion

Usage

1
2
3
4
5
neighborhood_graph(packages, level = 1L, type = "igraph",
  relation = c("Depends", "Imports", "LinkingTo", "Suggests",
  "Enhances"), strict = FALSE, interconnect = TRUE,
  ignore = c("datasets", "utils", "grDevices", "graphics", "stats",
  "methods"))

Arguments

packages

(non-empty character vector) Package names

level

(positive integer, Default: 1L) Depth of recursive dependency

type

(string, Default: "igraph") Graph object type. Either "network" or "igraph"

relation

(character vector) Types of graph edges. Must be a subset of c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances")

strict

(logical, Default: TRUE) Whether to consider all packages (alternately only 'relation' specific packages) when computing dependencies for the next level

interconnect

(flag, Default: TRUE) Whether to capture dependency among packages (of a given level) of the next level (See examples)

ignore

package names to ignore

Value

A network or igraph graph object

Author(s)

Srikanth KS

See Also

get_neighborhood, make_neighborhood_graph

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# explore first level dependencies
pkggraph::init(local = TRUE)
pkggraph::neighborhood_graph("caret")

# explore second level dependencies of class network
pkggraph::neighborhood_graph("caret", level = 2, type = "network")

# get 'imports' specific neighborhood of 'mlr' package with strict = TRUE
neighborhood_graph("mlr"
                   , level        = 2
                   , strict       = TRUE
                   , interconnect = FALSE
                   , relation     = "Imports")

# get 'imports' specific neighborhood of 'mlr' package with strict = FALSE
neighborhood_graph("mlr"
                   , level        = 2
                   , strict       = FALSE
                   , interconnect = FALSE
                   , relation     = "Imports")

talegari/pkggraph documentation built on May 6, 2019, 10:50 a.m.