PolyGenius
Contents

provenance

Access an object's provenance record

Reads and writes the record of the call that produced a value: what was run, what the caller supplied, and what the operation resolved. A bare value carries it as an attribute; a PolyGeniusAssociation or PolyGeniusEvaluation carries it as a field.

  • provenance(x) returns the whole record, provenance(x, field) one field of it.
  • provenance(x) <- value replaces the record, provenance(x, field) <- value sets or removes one field, creating an empty record first when none exists.

Usage

provenance(x, field = NULL, ...)

provenance(x, field = NULL) <- value

Default S3 method:

provenance(x, field = NULL, ...)

Default S3 method:

provenance(x, field = NULL) <- value

S3 method for class 'PolyGeniusResult'

provenance(x, field = NULL, ...)

S3 method for class 'PolyGeniusResult'

provenance(x, field = NULL) <- value

S3 method for class 'PGSLibrary'

provenance(x, field = NULL, ...)

S3 method for class 'PolyGeniusStudy'

provenance(x, field = NULL, ...)

Arguments

ArgumentDescription
xAn R object able to carry attributes, or a PolyGeniusResult, PGSLibrary or PolyGeniusStudy.
fieldField name, default NULL. A single non-empty string; NULL addresses the whole record.
...Unused. Present for S3 method compatibility.
valueA [PolyGeniusProvenance()](/reference/polygeniusprovenance/), a named list of fields (coerced to one), or NULL to drop the record. With a field, any value stored as that field, or NULL to remove it. Assigning onto a PGSLibrary or a PolyGeniusStudy aborts: those record how they were made when they are constructed, and an attribute written onto an R6 object would modify it by reference and be dropped by $clone().

Value

  • Getter: the PolyGeniusProvenance record, the value of field, or NULL when the record or the field is absent. Never a list of records -- one object carries at most one.
  • Setter: x with the record updated.

Examples

x <- list(a = 1)
provenance(x) <- PolyGeniusProvenance(name = "fit")
provenance(x)
provenance(x, "name")

See Also

Aliases: provenance, provenance<-, provenance.default, provenance<-.default, provenance.PolyGeniusResult, provenance<-.PolyGeniusResult, provenance.PGSLibrary, provenance.PolyGeniusStudy