map_l {tinylens} | R Documentation |
This lens allows you to access and modify elements of a list or vector based on their position or a logical condition.
map_l(l, .ptype = NULL)
l |
A lens that selects the elements to lens into |
.ptype |
The prototype of the data structure to return |
A lens that selects the specified elements
d <- list(list(a = 1, b = 2), list(a = 4, b = 9))
l <- index_l("a")
view(d, map_l(l))
over_map(d, map_l(l), sqrt)