Contents
PolyGeniusProvenance
Create a PolyGeniusProvenance record
Constructs one operation-provenance record for attachment to a PolyGenius object: what was run, what the caller supplied, and what the operation resolved or produced.
format() gives the operation, the version that made it and when, e.g.
compute$scores() · v1.0.0 · 2026-09-23 14:02. A version other than the running one is flagged
as v0.9.2 (running 1.0.0), which is what a record loaded from an older .pgd shows. The same
line closes the print of every object that holds a record in a field.
print() heads the record with the operation, the class name and the rest of that line, then
lists params as the caller wrote them and misc as R would write it, one bullet per entry.
call is shown only when there are no params, since otherwise it repeats them.
Usage
PolyGeniusProvenance(..., name = NULL, call = NULL, params = NULL, misc = NULL)
format.PolyGeniusProvenance(x, ...)
print.PolyGeniusProvenance(x, ...)Arguments
| Argument | Description |
|---|---|
... | For the constructor, further named fields to append; they print after misc. Unused by format() and print(). It comes first so the named formals below must be matched exactly: a misspelled nam = becomes a field of its own rather than partial-matching name. |
name | Character scalar or NULL (default). The operation -- compute$scores, generate$models. |
call | Character scalar or NULL (default). The deparsed creating call, bounded. |
params | List or atomic vector, or NULL (default). What the caller supplied to the operation, as argument expressions. |
misc | List or atomic vector, or NULL (default). What the operation resolved or produced. |
x | A PolyGeniusProvenance. |
Value
An object of S3 class c("PolyGeniusProvenance", "list"): the named fields
themselves, not a wrapper around them. name, call, params and misc are dropped when
NULL, so a call with no arguments still yields a record carrying only created and
version.
format() returns a character scalar.
print() returns x, invisibly. Called for its console output.
Details
Field types are not validated and unknown fields are kept, so the record can evolve without breaking existing ones.
created and version are stamped here and are not settable by a call site: they say when
the thing was made and which package version made it. version is the version that was
running at construction, so an object loaded from a .pgd written by an older release keeps
reporting that older version, which is the point -- it describes the thing, not the session
reading it.
Because created is a wall clock, two runs of the same call produce records that differ in
that one field. A test comparing two objects or two records for identity blanks it first; see
pg.undated() in the unit tier's helpers.
Examples
PolyGeniusProvenance(
name = "fit_model",
params = list(method = "glm"),
misc = list(n.variants = 1200L)
)