makeCallGraph

0th

Percentile

Create a graph representing which functions call other functions

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

Keywords
hplot, programming
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

Note

We may extend this to deal with global variables and methods

See Also

The graph and Rgraphviz packages.

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

Aliases
  • makeCallGraph
  • makeCallGraph,list-method
  • makeCallGraph,character-method
  • makeCallGraph,function-method
Examples
# 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"))
# }
Documentation reproduced from package CodeDepends, version 0.6.5, License: GPL

Community examples

Looks like there are no examples yet.