unenclose: Unenclose a closure.

Description Usage Arguments Examples

View source: R/unenclose.r

Description

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

Usage

1

Arguments

f

a closure

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
power <- function(exp) {
  function(x) x ^ exp
}
square <- power(2)
cube <- power(3)

square
cube
unenclose(square)
unenclose(cube)

hadley/pryr documentation built on Feb. 20, 2018, 6:11 a.m.