Learn R Programming

pryr (version 0.1.6)

f: A compact syntax for anonymous functions.

Description

A compact syntax for anonymous functions.

Usage

f(..., .env = parent.frame())

Value

a function

Arguments

...

The last argument is the body of the function, all others are arguments to the function. If there is only one argument, the formals are guessed from the code.

.env

parent environment of the created function

Examples

Run this code
f(x + y)
f(x + y)(1, 10)
f(x, y = 2, x + y)

f({y <- runif(1); x + y})

Run the code above in your browser using DataLab