The lens version of attr and attr<-

attr_l(attrib)

Arguments

attrib

A length one character vector indicating the attribute to lens into.

Examples

(x <- structure(1:10, important = "attribute"))
#> [1] 1 2 3 4 5 6 7 8 9 10 #> attr(,"important") #> [1] "attribute"
view(x, attr_l("important"))
#> [1] "attribute"
set(x, attr_l("important"), "feature")
#> [1] 1 2 3 4 5 6 7 8 9 10 #> attr(,"important") #> [1] "feature"