| verify_capsule | R Documentation |
Runs the full custody chain over a capsule directory in one call:
the provenance manifest is readable, the pinned data file exists and
matches its recorded sha256 (and size_bytes / row count where
recorded), the schema still validates, a recorded analysis script
still matches its pinned hash, and every numeric cross-check stored
in a results manifest still reproduces its recorded PASS/DIFFER
status from its own observed/expected/tol fields.
verify_capsule(
capsule_dir,
provenance_file = "data_provenance.json",
data_file = NULL,
manifest_file = NULL,
script_file = NULL
)
capsule_dir |
Directory containing the capsule. |
provenance_file |
Provenance JSON filename inside |
data_file |
Data filename inside |
manifest_file |
Optional results-manifest JSON (as written by
|
script_file |
Optional analysis-script filename inside
|
Entirely offline: nothing is downloaded and nothing is written.
A list with ok (logical scalar: every check passed) and
checks (data.frame with columns check, ok, detail).
dir <- file.path(tempdir(), "capsule-example")
dir.create(dir, showWarnings = FALSE)
write.csv(data.frame(id = 1:3), file.path(dir, "d.csv"), row.names = FALSE)
prov <- list(resource = list(filename = "d.csv",
sha256 = sha256_file(file.path(dir, "d.csv"))))
jsonlite::write_json(prov, file.path(dir, "data_provenance.json"),
auto_unbox = TRUE)
verify_capsule(dir)$ok
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.