plotProfileCallGraph {proftools} | R Documentation |
Uses the graph and Rgraphviz packages to plot a call graph for
profile data produced by Rprof
.
plotProfileCallGraph(pd, layout = "dot", score = c("total", "self"), transfer = function(x) x, colorMap = NULL, mergeCycles = FALSE, edgesColored = TRUE, rankDir = "LR", ...)
pd |
profile data as returned by readProfileData . |
layout |
The layout method to use: One of "dot" ,
"neato" , and "twopi" . |
score |
character string specifying whether to use total time or self time for coloring nodes/edges; no color used if missing. |
transfer |
function; maps score values in unit interval to unit interval |
colorMap |
character vector of color specifications as produced by
rainbow ; transfer of score is mapped to
color |
mergeCycles |
logical; whether to merge each cycle of recursion into a single node |
edgesColored |
logical; whether to color edges |
rankDir |
The direction that the plot is laid out in, one of
either "TB" for Top-to-Bottom or "LR" for
Left-to-Right. The default value is "LR" . This
argument is only useful for dot layouts. |
... |
additional arguments for the graphNEL plot
method. |
Color is used to encode the fraction of total or self time spent in
each function or call. The scores used correspond to the values in
the printed representation produced by printProfileCallGraph
.
For now, see the gprof
manual for further details. The color
encoding for a score s
and a color map m
is
m[ceiling(length(m) * transfer(s))]
Used for side effect.
Because of lazy evaluation, nested calls like f(g(x))
appear in the profile graph as f
or one of its callees
calling g
.
Luke Tierney
User manual for gprof
, the GNU profiler.
Graphviz: http://www.research.att.com/sw/tools/graphviz/
Rprof
,
summaryRprof
,
readProfileData
,
flatProfile
,
printProfileCallGraph
,
profileCallGraph2Dot
## Not run: ## Rprof() is not available on all platforms Rprof(tmp <- tempfile()) example(glm) Rprof() plotProfileCallGraph(readProfileData(tmp)) plotProfileCallGraph(readProfileData(tmp), score = "total") unlink(tmp) ## End(Not run)