View source: R/lsAccessibleVariable.R
lsAccessibleVariable | R Documentation |
List the variables that a function can access
lsAccessibleVariable(fun, printValue = FALSE, variable2print = NULL)
fun |
function object. |
printValue |
logical, if TRUE, print the value of each variable that
the |
variable2print |
character or vector of charactor or NULL. If it's NULL and
|
the name(s) of variable(s) which can be accessed by 'fun'
function.
## Not run:
a = 1
f = function(b) {
ab = 2
innerF = function(c) ab * b * c
return(innerF)
}
funObj = f(2)
lsAccessibleVariable(f) # global environment.
lsAccessibleVariable(funObj) # environment within function f.
lsAccessibleVariable(funObj, T) # all variables in environment within function f.
lsAccessibleVariable(funObj, T, "ab") # variables 'ab' in environment within function f.
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.