Learn R Programming

tinylens (version 0.1.0)

slice_l: Slice lens

Description

Lens into a slice of a vector.

Usage

slice_l(idx)

Value

A lens that selects the specified slice

Arguments

idx

Indices of the elements to lens into

Details

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

Examples

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

Run the code above in your browser using DataLab