R/verbs.R
over.Rd
Get the data pointed to by a lens, apply a function and replace it with the result.
over(d, l, f)
the data (or an oscope)
the lens (or the function if d is an oscope)
d
oscope
the function (or nothing if d is an oscope)
third_l <- index(3) over(1:5, third_l, function(x) x + 2)#> [1] 1 2 5 4 5# returns c(1:2, 5, 4:5)