Learn R Programming

RWsearch (version 4.6)

p_deps: Dependencies and Reverse Dependencies of Packages

Description

p_deps returns the (reverse) dependencies of a (vector of) package(s). It is a wrapper of the tools::package_dependencies function. A warning is issued for packages that are not in crandb + .libPaths() (for instance in BioConductor).

p_depsrev returns the reverse dependencies.

p_network returns the package dependencies as a network of nodes and links. It is called by n_graphF and n_graphS.

Usage

p_deps(..., char = NULL, which = "DIL", recursive = FALSE,
  reverse = FALSE, verbose = getOption("verbose"),
  crandb = get("crandb", envir = .GlobalEnv))

p_depsrev(..., char = NULL, which = "DIL", recursive = FALSE, reverse = FALSE, verbose = getOption("verbose"), crandb = get("crandb", envir = .GlobalEnv))

p_network(..., char = NULL, which = "DIL", reverse = FALSE, exclpkgs = TRUE, crandb = get("crandb", envir = .GlobalEnv))

Arguments

...

any format recognized by cnsc, excluding list. A package or a vector of packages listed in crandb or in installed.packages().

char

(name to) a character vector. Use this argument if ... fails or if you call the function from another function. If used, argument ... is ignored.

which

character vector. A sub-vector of c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances"). The short forms "D", "I", "L", "S", "N", "DL", "DI", "DIL", "DILS", "DILN", "DILSN", "SN" are accepted. "N" is for "Enhances" as the single letter "E" is used by R as a shortcut to EXPR, a reserved word.

recursive

logical. Search for (reverse) dependencies of (reverse) dependencies.

reverse

logical. Search for reverse dependencies.

verbose

logical. Returns additional information about the search.

crandb

data.frame crandb. Also accepted is NULL which will search in the local installed.packages(). This later form allows (private) packages that are not listed in crandb.

exclpkgs

logical or character vector. TRUE excludes from the network of nodes and links the dependencies c("graphics", "grDevices", "methods", "stats", "tools", "utils"). FALSE includes them. You can provide your own vector of packages to exclude them from the network of nodes and links.

Examples

Run this code
# NOT RUN {
## In real life, download crandb from CRAN or load it from your directory 
## with functions crandb_down() or crandb_load(). 
## In this example, we use a small file.
crandb_load(system.file("data", "zcrandb.rda", package = "RWsearch"))

p_deps(canprot, FatTailsR) 
p_deps(canprot, FatTailsR, recursive = TRUE)
p_deps(canprot, FatTailsR, recursive = TRUE, which = "DIL")
p_deps(actuar, reverse = TRUE, which = "DILSN")

p_network(canprot, FatTailsR, exclpkgs = FALSE)

# }

Run the code above in your browser using DataLab