Learn R Programming

tinylens (version 0.1.0)

c_l: Lens for accessing and modifying nested elements of a list or vector

Description

Convenience function that mirrors purrr::pluck().

Usage

c_l(...)

Value

A lens that combines all specified lenses (left to right).

Arguments

...

A sequence of lenses and/or integers/logical vectors

Examples

Run this code
d <- list(a = list(b = 1, c = 2), b = list(b = 3, c = 4))
l <- c_l("a", "b")
view(d, l)

Run the code above in your browser using DataLab