slice_l {tinylens}R Documentation

Slice lens

Description

Lens into a slice of a vector.

Usage

slice_l(idx)

Arguments

idx

Indices of the elements to lens into

Details

This lens performs indexing using single bracket notation, i.e., x[idx].

Value

A lens that selects the specified slice

Examples

x <- letters[1:10]
l <- slice_l(1:5)
view(x, l)

[Package tinylens version 0.1.0 Index]