makeVariableGraph | R Documentation |
This creates a graph of nodes and edges describing the relationship of how some variables are used in defining others.
makeVariableGraph(doc, frags = readScript(doc), info = getInputs(frags),
vars = getVariables(info, inputs = free), free = TRUE)
doc |
the name of the script file |
frags |
the code fragments from the script as a |
info |
the |
vars |
a character vector giving the names of the variables in the scripts. By default, these are the variables defined in the script. |
free |
a logical value that is passed to |
Note that this collapses variables with the same name into a single node. Therefore, if the code uses the same name for two unrelated variables, there may be some confusion.
An object of class graphNEL
from the graph
package.
Duncan Temple Lang
readScript
getInputs
getVariables
graph
Rgraphviz
## Not run:
u = url("http://www.omegahat.net/CodeDepends/formula.R")
sc = readScript(u)
close(u)
g = makeVariableGraph(, sc)
## End(Not run)
f = system.file("samples", "results-multi.R", package = "CodeDepends")
sc = readScript(f)
g = makeVariableGraph( info = getInputs(sc))
if(require(Rgraphviz))
plot(g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.