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 (or NULL if absent).

  • slotAttributes(x, field) returns one named attribute group.

  • slotAttributes(x) <- value replaces the full grouped attribute object.

  • slotAttributes(x, field) <- value sets 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 NULL, a symbol, or a single non-empty character string.

Unused. Present for S3 compatibility.

value

Replacement value for the full grouped attribute object or a single named group. Setting a named group to NULL removes it.

Value

  • Getter: a “PolyGeniusAttribute” object, one named attribute group, or NULL.

  • 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")