Learn R Programming

lenses (version 0.0.3)

slot_l: Slot lens

Description

The lens equivalent of @ and @<- for getting and setting S4 object slots.

Usage

slot_l(slot)

Arguments

slot

the name of the slot

Examples

Run this code
# NOT RUN {
new_class <- setClass("new_class", slots = c(x = "numeric"))
(x <- new_class())

view(x, slot_l("x"))
set(x, slot_l("x"), 1:10)
# }

Run the code above in your browser using DataLab