Learn R Programming

wrapr (version 2.1.0)

makeFunction_se: Build an anonymous function.

Description

Build an anonymous function.

Usage

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

Value

user defined function.

Arguments

params

formal parameters of function, unbound names.

body

substituted body of function to map arguments into.

env

environment to work in.

See Also

lambda, defineLambda, named_map_builder

Examples

Run this code

f <- makeFunction_se(as.name('x'), substitute({x*x}))
f(7)


g <- makeFunction_se(c(as.name('x'), as.name('y')), substitute({ x + 3*y }))
g(1,100)


Run the code above in your browser using DataLab