Description Usage Arguments Details Value Functions
Since R does not require that we declare local variables, and since the variables that are assigned to a local scope depend on the runtime execution of functions, we cannot determine with any certainty which variables will be assigned to in any given scope at any given program point. So the best we can do is figure out which variables are potentially assigned to. Which is what this function does.
1 2 3 4 | collect_assigned_symbols_in_expression(expr, env, params = list(),
topdown = list())
collect_assigned_symbols_in_function(fun, topdown = list())
|
expr |
The expression to analyse |
env |
Environment in which to look up symbols. |
params |
Parameters for the function being analysed (if these are needed). |
topdown |
Information to pass top-down in the traversal. |
fun |
The function whose body we should analyse |
The collect_assigned_symbols_in_function()
function reformats the collected
data into a character vector, removes duplications, and remove the
formal parameters of the function from the list, so those are not considered
local variables (rather, they are considered formals and presumably handled
elsewhere as such).
A list containing the symbols that were assigned to.
collect_assigned_symbols_in_expression
: Analyse an expression.
collect_assigned_symbols_in_function
: Analyse the body of a function.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.