CodeDepends (version 0.6.5)

makeTaskGraph: Create a graph connecting the tasks within a script

Description

This function create a graph connecting the high-level tasks within a script. The tasks are blocks of code that perform a step in the process. Each code block has input and output variables. These are used to define the associations between the tasks and which tasks are inputs to others and outputs that lead into others.

Usage

makeTaskGraph(doc, frags = readScript(doc), info = as(frags, "ScriptInfo"))

Arguments

doc

the name of the script file

frags

the code blocks in the script

info

the meta-information detailing the inputs and outputs of the different code blocks/fragments

Value

An object of class graphNEL-class.

See Also

readScript getInputs

Examples

Run this code
# NOT RUN {
 f = system.file("samples", "dual.R", package = "CodeDepends")
 g = makeTaskGraph(f)

 if(require(Rgraphviz))
   plot(g)

 f = system.file("samples", "parallel.R", package = "CodeDepends")
 g = makeTaskGraph(f)

 if(require(Rgraphviz))
   plot(g)

 f = system.file("samples", "disjoint.R", package = "CodeDepends")
 g = makeTaskGraph(f)

 if(require(Rgraphviz))
   plot(g)
# }

Run the code above in your browser using DataCamp Workspace