#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)
Run the code above in your browser using DataLab