getVariables {CodeDepends} | R Documentation |
Get the names of the variables used in code
Description
These functions and methods allow one to get the names of the variables used within a script or block of code and from various derived types.
Usage
getVariables(x, inputs = FALSE, functions = TRUE, ...)
Arguments
x |
the object with information about the variables |
inputs |
a logical indicating wether to include the input
variables or just return the output variables, i.e. those on the
left hand side of of an assignment. Defaults to |
functions |
Indicates what types of functions should be
included. |
... |
Passed to |
Value
A character vector, with possibly repeated values, giving the names of the variables. If an annotated script was used, the vector is named by the sections of the script.
Author(s)
Duncan Temple Lang
See Also
Examples
f = system.file("samples", "namedAnnotatedScript.R", package = "CodeDepends")
sc = readScript(f, "labeled")
getVariables(sc)
getVariables(sc[[3]])