Contents
artifacts
Access an object's plot-support artifacts
Reads and writes the artifact tables an analysis emitted alongside its results. A bare value
carries them as an attribute; a PolyGeniusAssociation or PolyGeniusEvaluation carries
them in $artifacts.
artifacts(x)returns every artifact,artifacts(x, field)one of them.artifacts(x) <- valuereplaces them all,artifacts(x, field) <- valuesets or removes one, creating an empty set first when none exists.
Usage
S3 method for class 'PolyGeniusAssociation'
artifacts(x, field = NULL, ...)
artifacts(x, field = NULL, ...)
artifacts(x, field = NULL) <- valueDefault S3 method:
artifacts(x, field = NULL, ...)Default S3 method:
artifacts(x, field = NULL) <- valueS3 method for class 'PolyGeniusResult'
artifacts(x, field = NULL, ...)S3 method for class 'PolyGeniusResult'
artifacts(x, field = NULL) <- valueArguments
| Argument | Description |
|---|---|
x | An R object able to carry attributes, or a PolyGeniusResult. |
field | Artifact name, default NULL. A single non-empty string; NULL addresses every artifact. |
... | Unused. Present for S3 method compatibility. |
value | A named list of artifacts, or NULL to drop them. With a field, the value stored as that artifact, or NULL to remove it. Stored verbatim: on a [PolyGeniusAssociation](/reference/polygeniusassociation/) the value is not re-compacted against $fits, so writing back a table the getter joined leaves the identity columns duplicated in the store, and an identity column present there shadows $fits on the next read. |
Value
- Getter: a named list of every artifact, the one named by
field, orNULLwhen the set or the entry is absent. On aPolyGeniusAssociationeach tabular artifact has the$fitscolumns joined on and moved to the front; a non-tabular one is returned unchanged. - Setter:
xwith the artifacts updated.
Examples
assoc <- PolyGeniusAssociation(
results = data.frame(.fit = 1L, outcome = "ldl", estimate = 0.2),
fits = data.frame(.fit = 1L, fit.id = "f1", outcome = "ldl"),
artifacts = list(grid = data.frame(.fit = 1L, x = 1:3, fitted = c(0.1, 0.2, 0.3)))
)
artifacts(assoc, "grid")
evaluation <- PolyGeniusEvaluation(
results = data.frame(model = "m1", metric = "auc", value = 0.7),
artifacts = list(roc = data.frame(fpr = c(0, 1), tpr = c(0, 1)))
)
artifacts(evaluation, "roc")See Also
provenance(), diagnostics(), PolyGeniusResult
Other result-objects:
PolyGeniusAssociation(),
PolyGeniusEvaluation(),
PolyGeniusResult(),
diagnostics(),
federate(),
provenance()