getDependsThread | R Documentation |
This function is used to determine which code blocks in an R "script" that are needed to define a particular variable. This finds the smallest complete set of expressions or code blocks that must be evaluated in order to define the specified variable(s). It omits expressions that do not provide outputs that are not used as inputs to (indirectly) define the speciied variable.
getDependsThread(var, info, reverse = TRUE)
var |
the name of a variable in the script |
info |
a list of the meta-information for each of the code elements in the script. |
reverse |
a logical value that determines whether we reverse the indices of the expressions or leave them as end-to-first. |
An integer vector giving the indices of the
script code blocks which are required to define
var
.
Duncan Temple Lang
getExpressionThread
readScript
getVariables
sc = readScript(system.file("samples", "dual.R", package =
"CodeDepends"))
sci = getInputs(sc, formulaInputs = TRUE) ## script has formula with no data.frame
idx = getDependsThread("fit", sci)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.