makeDepGraph: Create dependency graph from available packages.

Description Usage Arguments See Also Examples

View source: R/makeDepGraph.R

Description

Each package is a node, and a dependency is an edge

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
makeDepGraph(
  pkg,
  availPkgs,
  repos = getOption("repos"),
  type = "source",
  suggests = TRUE,
  enhances = FALSE,
  includeBasePkgs = FALSE,
  ...
)

Arguments

pkg

Character vector of packages.

availPkgs

Data frame with an element called package. The package element is a vector of available packages. Defaults to reading this list from CRAN, using available.packages()

repos

URL(s) of the 'contrib' sections of the repositories, e.g. "http://cran.us.r-project.org". Passed to available.packages()

type

Possible values are (currently) "source", "mac.binary" and "win.binary": the binary types can be listed and downloaded but not installed on other platforms. Passed to download.packages().

suggests

If TRUE, retrieves Suggests dependencies (non-recursively)

enhances

If TRUE, retrieves Enhances dependencies (non-recursively)

includeBasePkgs

If TRUE, include base R packages in results

...

Other arguments passed to available.packages()

See Also

pkgDep() to extract package dependencies

Other dependency functions: basePkgs(), pkgDep(), plot.pkgDepGraph()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
availPkgs <- cranJuly2014

## Not run: 
availPkgs <- pkgAvail(
  repos = c(CRAN = getOption("minicran.mran")),
  type = "source"
  )

## End(Not run)


# Create dependency graph using stored database of available packages
p <- makeDepGraph(
  c("ggplot2", "forecast"),
  availPkgs = availPkgs
)

if(require(igraph)) plot(p)



## Not run: 
  # Create dependency graph using newly retrieved database from CRAN

  p <- makeDepGraph(
  c("ggplot2", "forecast"),
  repos = c(CRAN = getOption("minicran.mran")),
  type = "source"
)
if(require(igraph)) plot(p)

## End(Not run)

miniCRAN documentation built on Sept. 16, 2020, 1:07 a.m.