setSlots | R Documentation |
Given the current object, the function setSlots
will take name-value
pair inputs either as named arguments or a list
and replace the values of
the specified slots. This is a convenient function for updating slots in
an S4 class object.
setSlots(object, ..., check = TRUE)
object |
An S4 object with slots to replace |
... |
Slot name and value pairs either as named arguments
or a named list, e.g., |
check |
logical(1L) Whether to run validObject after the slot replacement |
The object input with updated slot data
H. Pagès
setClass("A", representation = representation(slotA = "character"))
aclass <- new("A", slotA = "A")
setSlots(aclass, slotA = "B")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.