View source: R/functions_bfcif.R
get_args | R Documentation |
returns parameters of calling function as a named list.
get_args(env = parent.frame(), to_ignore = character(), ...)
env |
Environment to collect variable from. By default this is the calling environment, i.e. the function containing a call to get_args. This may also be a function that returns an environment. |
to_ignore |
character names of variables to ignore. |
... |
Additional variables that should be considered as part of environment. |
parameters of calling function as a named list.
#The most common usage is to simply collect all local variables in a function
test_fun = function(x = 1, y = 2){
get_args()
}
test_fun()
#Specified variables may be ignored
test_fun2 = function(x = 1, y = 2){
get_args(to_ignore = "x")
}
test_fun2()
#Additional variables can also be added from higher environments
global_z = 3
test_fun3 = function(x = 1, y = 2){
get_args(env = parent.frame, to_ignore = character(), z = global_z)
}
test_fun3()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.