CodeDepends (version 0.6.0)

makeCallGraph: Create a graph representing which functions call other functions

Description

This function and its methods provide facilities for constructing a graph representing which functions call which other functions.

Usage

makeCallGraph(obj, all = FALSE, ...)

Arguments

obj

The name of one or more packages as a string, optionally prefixed with "package:". This can be a vector of package names. Currently the packages should already be on the search path. Other inputs may be supported in the future

all

a logical value that controls whether the graph includes all the functions called by any of the target functions. This will greatly expand the graph.

additional parameters for the methods

Value

An object of class graphNEL-class

See Also

The graph and Rgraphviz packages.

The SVGAnnotation package can be used to mae thee graphs interactive.

Examples

Run this code
# NOT RUN {
  gg = makeCallGraph("package:CodeDepends")
  if(require(Rgraphviz)) {
     plot(gg, "twopi")

     ag = agopen(gg, layoutType = "circo", name = "bob")
     plot(ag)
  }

  if(require(Rgraphviz)) {
      # Bigger fonts.
    zz = layoutGraph(gg)
    graph.par(list(nodes = list(fontsize = 48)))
    renderGraph(zz)
  }

    # Two packages
    library(codetools)
    gg = makeCallGraph(c("package:CodeDepends", "package:codetools"))
# }

Run the code above in your browser using DataCamp Workspace