Learn R Programming

DCC (version 1.2.1)

dcc_manifest: Build a reproducibility manifest for a cleaning run

Description

Captures everything needed to re-execute the read -> detect -> execute pipeline and verify byte-identical results: input file path and hash, rule file path and hash, the executed actions, id/default configuration, and content hashes of the cleaned data and the audit log (timestamps excluded).

Usage

dcc_manifest(x, path = NULL)

Value

A dcc_manifest object (named list with input, ruleset, action and output-hash sections), invisibly written to path when given.

Arguments

x

A dcc_result from dcc_execute, produced from a dcc_read input and dcc_detect findings (so input and rule sources are known).

path

Optional path to write the manifest as YAML (requires the yaml package).

See Also

dcc_rerun

Examples

Run this code
csv <- tempfile(fileext = ".csv")
writeLines(c("sid,score", "S1,90", "S2,150"), csv)
rules_file <- tempfile(fileext = ".yaml")
writeLines(c(
  "checks:",
  "  - id: R001",
  "    type: range",
  "    variable: score",
  "    min: 0",
  "    max: 100"
), rules_file)
if (requireNamespace("yaml", quietly = TRUE)) {
  x <- dcc_read(csv)
  f <- dcc_detect(x, dcc_rules(rules_file), id_var = "sid")
  res <- dcc_execute(x, f, actions = list(R001 = "set_na"),
                     id_var = "sid")
  dcc_manifest(res)
}

Run the code above in your browser using DataLab