This is the lens version of [

indexes_l(els)

indexes(els)

Arguments

els

a subset vector, can be integer, character of logical, pointing to one or more elements of the object

Functions

  • indexes: shorthand

Examples

x <- 1:10 view(x, indexes_l(3:5))
#> [1] 3 4 5
set(x, indexes_l(c(1,10)), NA)
#> [1] NA 2 3 4 5 6 7 8 9 NA
head(view(iris, indexes_l(c("Sepal.Length", "Species"))))
#> Sepal.Length Species #> 1 5.1 setosa #> 2 4.9 setosa #> 3 4.7 setosa #> 4 4.6 setosa #> 5 5.0 setosa #> 6 5.4 setosa