slot_l {lenses}R Documentation

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

new_class <- setClass("new_class", slots = c(x = "numeric"))
(x <- new_class())

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

[Package lenses version 0.0.3 Index]