View source: R/scriptInfoFuns.R
missingScriptVars | R Documentation |
For a given script, this function identifies variables used but not previously defined in the script and then searches other scripts to find code that creates those variables.
missingScriptVars(script, dir = ".",
allScripts = list.files(dir, pattern = "\\.R$", full.names = TRUE),
varDefs = varDefsByFile(, allScripts),
unbox = TRUE)
script |
the paths to the file names containing the R code to be analyzed |
dir |
the directory in which to find the other scripts |
allScripts |
the full paths to all the scripts in which to look for variable definitions |
varDefs |
the pre-computed collection of variable definitions across all scripts. |
unbox |
a scalar logical that controls whether
to keep the list structure for the return ( |
A list with the same length as script
with an element corresponding to each element of
script
.
Each element is a named list of character vectors.
The names identify the variables found undefined but used in the script
.
The character vector gives the names of the files containing one or more definition for that variable.
If there is only one element in script
and unbox
is TRUE
, that first element is returned directly,
i.e., not a list of length 1 containing the element.
Duncan Temple Lang
getScriptGlobals
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.