| record | R Documentation |
Appends one named cross-check entry to a manifest, classifying it as
PASS, DIFFER, or INFO, printing a formatted line to the console,
and returning the updated manifest.
record(
manifest,
name,
observed,
expected,
tol = 1e-04,
group = "general",
synthetic = FALSE
)
manifest |
A manifest as returned by |
name |
Unique name for this cross-check; used as the result key. |
observed |
The observed value (numeric or otherwise). |
expected |
The expected value to compare against. |
tol |
Numeric tolerance; a numeric pair within |
group |
Optional grouping label for the entry. Defaults to
|
synthetic |
Logical; if |
The updated manifest, returned so calls can be chained.
man <- make_manifest(list(project = "demo"), environment = FALSE)
# Within tolerance -> PASS.
man <- record(man, "mean_matches", observed = 1.0001, expected = 1,
tol = 0.001)
man$results$mean_matches$status # "PASS"
# Outside tolerance -> DIFFER.
man <- record(man, "sd_matches", observed = 2.5, expected = 2.0, tol = 0.01)
man$results$sd_matches$status # "DIFFER"
# Synthetic data -> INFO (comparison not meaningful).
man <- record(man, "synthetic_row", observed = 5, expected = 5,
synthetic = TRUE)
man$results$synthetic_row$status # "INFO"
# Calls chain: record() returns the mutated manifest.
length(man$results) # 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.