vec_data_l {tinylens} | R Documentation |
Vector data lens
Description
Allows mutation of vector data while preserving attributes, e.g., labels or names.
Usage
vec_data_l
Format
An object of class tinylens::lens
(inherits from S7_object
) of length 1.
Examples
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)
[Package tinylens version 0.1.0 Index]