Description Usage Arguments Value Author(s) See Also Examples
These functions allow one to get and visualize information about when variables are defined, redefined and used within and across blocks of code in a script or the body of a function.
1 2 3 4 5 6 |
doc |
the name of a file or a connection which identifies the code to be analyzed |
info |
meta-information extracted from the code identifying the
inputs and outputs. See |
vars |
the variables of interest |
functions |
What type of functions should be included in the
timeline: |
x |
the |
var.srt |
rotation of the labels for the vertical axis listing the variables |
var.mar |
the number of lines to leave for the vertical axis. The labels for this are variable names so one often needs more space or to change the size of the labels. |
var.cex |
character expansion factor for the variable labels on the vertical axis. |
main |
the title of the plot |
... |
Passed to down to getInputs for the default |
getDetailedTimelines
returns a data frame
with four columns: step
, used
, defined
, and
var
. Step represents steps within the timeline, with the same
value indicating that the described event are occuring at the same
time. used
indicates whether var
was used at that step,
and defined
indicates whether var
was defined. Many rows
will have FALSE
for both as the variable is not used in that
code block.
Duncan Temple Lang
1 2 3 4 5 6 7 8 9 10 | f = system.file("samples", "results-multi.R", package = "CodeDepends")
sc = readScript(f)
dtm = getDetailedTimelines(sc, getInputs(sc))
plot(dtm)
table(dtm$var)
# A big/long function
info = getInputs(arima0)
dtm = getDetailedTimelines(info = info)
plot(dtm, var.cex = .7, mar = 4, srt = 30)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.