Learn R Programming

tinylens (version 0.1.0)

attr_l: Attributes lens

Description

Lens into a named attribute of an object.

Usage

attr_l(name)

Value

A lens that selects the specified attribute

Arguments

name

Name of the attribute to lens into

Examples

Run this code
x <- 1:10
attr(x, "label") <- "my_label"
l <- attr_l("label")
view(x, l)
set(x, l, "new_label")

Run the code above in your browser using DataLab