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

unenclose

Unenclose a closure.


Description

Unenclose a closure by substituting names for values found in the enclosing environment.

Usage

unenclose(f)

Arguments

f

a closure

Examples

power <- function(exp) {
  function(x) x ^ exp
}
square <- power(2)
cube <- power(3)

square
cube
unenclose(square)
unenclose(cube)

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.