R/base-lenses.R
index_l.Rd
This is the lens version of [[
[[
index_l(el) index(el)
The element the lens should point to can be an integer or name.
integer
index: shorthand
index
x <- 1:10 view(x, index_l(1))#> [1] 1set(x, index(5), 50)#> [1] 1 2 3 4 50 6 7 8 9 10head(view(iris, index(2)))#> [1] 3.5 3.0 3.2 3.1 3.6 3.9