cordon | R Documentation |
Puts a function's body and its arguments into an environment for evaluation, and afterwards allows extraction of any variables from the body, not just a return value.
cordon( fun, ..., arguments = list(), envir = environment(), file_path = NULL, variables = NULL, version = NA, version_fmt = "_v%03d", copy_args = FALSE, timestamp = TRUE, timestamp... = list(), action = c("run", "save", "load", "skip", "archive"), evaluate_dots = TRUE, create_path_dir = TRUE, verbose = TRUE )
fun |
The function to be evaluated. | ||||||||||
... |
Arguments to be passed into | ||||||||||
arguments |
A list of additional arguments for passing into | ||||||||||
envir |
Environment where | ||||||||||
file_path |
For | ||||||||||
variables |
A character string naming variables among the arguments to, or in the body of, | ||||||||||
copy_args |
Logical: Should all named arguments to | ||||||||||
timestamp |
A logical value deciding whether a current timestamp (default format | ||||||||||
action |
A character string denoting the purpose of calling
|
The environment in which the body of fun
was evaluated.
## Not run: f <- function(x = "frog", ...) { args <- get_dots(...)$arguments; nines <- args$beast + 333; bite <- args$bite; return (nop()) } e <- cordon(f, bite = "me", 3.14, beast = 666, TRUE, envir = globalenv(), variables = "nines") get("nines", envir = globalenv()) e$bite ls(e, all = TRUE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.