setSlots: Convenience function to set slot values

setSlotsR Documentation

Convenience function to set slot values

Description

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.

Usage

setSlots(object, ..., check = TRUE)

Arguments

object

An S4 object with slots to replace

...

Slot name and value pairs either as named arguments or a named list, e.g., slotName = value.

check

logical(1L) Whether to run validObject after the slot replacement

Value

The object input with updated slot data

Author(s)

H. Pagès

Examples


setClass("A", representation = representation(slotA = "character"))

aclass <- new("A", slotA = "A")

setSlots(aclass, slotA = "B")


Bioconductor/BiocUtils documentation built on Oct. 31, 2024, 1:35 a.m.