lambda: Build an anonymous function.

Description Usage Arguments Value See Also Examples

View source: R/lambda.R

Description

Mostly just a place-holder so lambda-symbol form has somewhere safe to hang its help entry.

Usage

1

Arguments

...

formal parameters of function, unbound names, followed by function body (code/language).

env

environment to work in

Value

user defined function.

See Also

defineLambda, makeFunction_se, named_map_builder

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#lambda-syntax: lambda(arg [, arg]*, body [, env=env])
# also works with lambda character as function name
# print(intToUtf8(0x03BB))

# example: square numbers
sapply(1:4, lambda(x, x^2))

# example more than one argument
f <- lambda(x, y, x+y)
f(2,4)

WinVector/wrapr documentation built on Nov. 21, 2020, 8:31 p.m.