buildPkgDepGraph {reposTools}R Documentation

A function to build a package dependency graph

Description

Given a package name, will generate a dependency graph for that package, detailing all of that package's dependencies, those packages' dependencies, etc.

Usage

buildPkgDepGraph(pkg, repEntry, type, curNodes = vector(mode = "character"))

Arguments

pkg The name of the package to use as the base
repEntry If desired, the specific repository to look for the package. Defaults to the reposTools system repositories if none is specified.
type The download type, ie 'unix', 'windows', etc. If not specified, will attempt to determine the proper type.
curNodes Any current nodes in a graph. Not intended to be used by the end user.

Details

This function will recursively generate a dependency graph for a package by first looking at all of its dependencies and then tracking downt he dependencies for each of those packages, and so on. After the conclusion of every recursive call, the new subgraph is connected to the primary graph via the join method for graphs.

If multiple versions of a package are found, the highest version of the package will be selected for usage in this function.

Value

An object of class graphNEL detailing the dependency graph for the specified package.

Author(s)

Jeff Gentry

See Also

graphNEL-class

Examples

  if (require(graph)) {
    z <- buildPkgDepGraph("reposTools")
    if (interactive()) {
      ## If you have Rgraphviz package, can plot the graph
      if (require(Rgraphviz))
         plot(z)
    }
  }

[Package Contents]