Build an anonymous function.

makeFunction_se(params, body, env = parent.frame())

Arguments

params

formal parameters of function, unbound names.

body

substituted body of function to map arguments into.

env

environment to work in.

Value

user defined function.

See also

Examples

f <- makeFunction_se(as.name('x'), substitute({x*x})) f(7)
#> [1] 49
g <- makeFunction_se(c(as.name('x'), as.name('y')), substitute({ x + 3*y })) g(1,100)
#> [1] 301