slice_l {tinylens} | R Documentation |
Lens into a slice of a vector.
slice_l(idx)
idx |
Indices of the elements to lens into |
This lens performs indexing using single bracket notation, i.e., x[idx]
.
A lens that selects the specified slice
x <- letters[1:10]
l <- slice_l(1:5)
view(x, l)