The lens equivalent of @ and @<-
for getting and setting S4 object slots.
slot_l(slot)
| slot | the name of the slot |
|---|
new_class <- setClass("new_class", slots = c(x = "numeric")) (x <- new_class())#> An object of class "new_class" #> Slot "x": #> numeric(0) #>#> numeric(0)#> An object of class "new_class" #> Slot "x": #> [1] 1 2 3 4 5 6 7 8 9 10 #>