oscope {lenses} | R Documentation |
Bind data to a lens
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
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
list(a = 5, b = 1:3, c = 8) %>%
oscope() %.%
index_l("b") %.%
index_l(1) %>%
set(10)
[Package lenses version 0.0.3 Index]