makeCallGraph {CodeDepends} | R Documentation |
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
|
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
Author(s)
Duncan Temple Lang
See Also
The graph
and Rgraphviz
packages.
The SVGAnnotation
package can be used to mae thee graphs interactive.
Examples
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"))