This is the lens version of [[

index_l(el)

index(el)

Arguments

el

The element the lens should point to can be an integer or name.

Functions

  • index: shorthand

Examples

x <- 1:10 view(x, index_l(1))
#> [1] 1
set(x, index(5), 50)
#> [1] 1 2 3 4 50 6 7 8 9 10
head(view(iris, index(2)))
#> [1] 3.5 3.0 3.2 3.1 3.6 3.9