vec_data_l {tinylens} | R Documentation |
Allows mutation of vector data while preserving attributes, e.g., labels or names.
vec_data_l
An object of class tinylens::lens
(inherits from S7_object
) of length 1.
x <- letters[1:10]
names(x) <- letters[1:10]
# toy function that strips names; most functions from `stringr` do this
f <- function(x) toupper(unname(x))
# apply the function without losing attributes
over(x, vec_data_l, f)