Learn R Programming

tinylens (version 0.1.0)

vec_data_l: Vector data lens

Description

Allows mutation of vector data while preserving attributes, e.g., labels or names.

Usage

vec_data_l

Arguments

Format

An object of class tinylens::lens (inherits from S7_object) of length 1.

Examples

Run this code
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)

Run the code above in your browser using DataLab