attr_l {tinylens} | R Documentation |
Lens into a named attribute of an object.
attr_l(name)
name |
Name of the attribute to lens into |
A lens that selects the specified attribute
x <- 1:10
attr(x, "label") <- "my_label"
l <- attr_l("label")
view(x, l)
set(x, l, "new_label")