Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

f

A compact syntax for anonymous functions.


Description

A compact syntax for anonymous functions.

Usage

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

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

Value

a function

Examples

f(x + y)
f(x + y)(1, 10)
f(x, y = 2, x + y)

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

pryr

Tools for Computing on the Language

v0.1.4
GPL-2
Authors
Hadley Wickham [aut, cre], R Core team [ctb] (Some code extracted from base R)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.