oscope: Bind data to a lens

Description Usage Arguments Examples

View source: R/lens.R

Description

To flatten lens composition, you can prespecify the data the lens with be applied to by constructing an objectoscope. These can be integrated easily with normal data pipelines.

Usage

1
oscope(d, l = id_l)

Arguments

d

The data for interest

l

The lens to bind the data to. Defaults to the identity lens

Examples

1
2
3
4
5
list(a = 5, b = 1:3, c = 8) %>%
  oscope()   %.%
  index_l("b") %.%
  index_l(1)   %>%
  set(10)

lenses documentation built on May 2, 2019, 8:51 a.m.