slotAttributes
Access grouped PolyGenius attributes
Description
slotAttributes() and its replacement form slotAttributes<-() provide a generic S3 API for reading and writing grouped attribute payloads stored on PolyGenius objects.
-
slotAttributes(x)returns the full grouped attribute object (orNULLif absent). -
slotAttributes(x, field)returns one named attribute group. -
slotAttributes(x) <- valuereplaces the full grouped attribute object. -
slotAttributes(x, field) <- valuesets or removes one named attribute group.
Semantic helpers such as slotLog(), slotArtifacts(), and slotDiagnostics() are thin wrappers around this grouped accessor.
Usage
slotAttributes(x, field = NULL, ...)
slotAttributes(x, field = NULL) <- value
## Default S3 method:
slotAttributes(x, field = NULL, ...)
## Default S3 replacement method:
slotAttributes(x, field = NULL) <- value
Arguments
x
|
An R object. |
field
|
Optional attribute-group name. May be |
…
|
Unused. Present for S3 compatibility. |
value
|
Replacement value for the full grouped attribute object or a single named group. Setting a named group to |
Value
-
Getter: a
“PolyGeniusAttribute”object, one named attribute group, orNULL. -
Setter: the modified object
x.
See Also
PolyGeniusAttribute(), slotLog(), slotArtifacts(), slotDiagnostics()
Examples
x <- list(a = 1)
slotAttributes(x)
#> NULL
slotAttributes(x, artifacts) <- list(roc = data.frame(fpr = c(0, 1), tpr = c(0, 1)))
slotAttributes(x)
slotAttributes(x, "artifacts")