feval | R Documentation |
Evaluates a function by taking its argument values by name from the specified environment.
feval(fun, envir = parent.frame(), enclos = globalenv(), default = NULL)
fun |
Fuction to evaluate. |
envir |
Environment in which |
enclos |
Environment in which to look for objects not found in |
default |
Default value (or function) to return (or evaluate) if requirements are not met. |
f <- function(x) {x + 1}
feval(f, envir = list(x = 1))
feval(f, envir = list(y = 1))
## Not run:
feval(f, envir = list(y = 1), default = function() stop("Arguments not found"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.