env_l {lenses}R Documentation

Environment lens

Description

A lens into the environment of an object. This is the lens version of environment and environment<-

Usage

env_l

Format

An object of class lens of length 2.

Examples

x <- 10
f <- (function(){x <- 2; function() x + 1})()
f

f()
view(f, env_l)$x

g <- over(f, env_l, parent.env)
g()

[Package lenses version 0.0.3 Index]