Learn R Programming

DCC (version 1.2.1)

dcc_report: Generate a cleaning report (Report stage)

Description

Renders a self-contained HTML report in two audiences: a management summary (findings by quality dimension and severity, change volumes, exclusions, provenance and hashes) and an audit report that adds the reconciliation table and the cell-level change log. HTML is generated directly, without a pandoc/rmarkdown dependency.

Usage

dcc_report(x, path = NULL, audience = c("summary", "audit"),
  max_rows = 1000L)

Value

The HTML document as a character string, invisibly. Written to path when given.

Arguments

x

A dcc_result from dcc_execute.

path

Output .html file path, or NULL to only return the HTML string.

audience

"summary" (management layer, default) or "audit" (adds the full findings table with evidence, the findings-to-changes reconciliation, and the cell-level change log).

max_rows

Maximum audit-log rows embedded in the HTML (default 1000); the complete log is exported with dcc_export_log.

Examples

Run this code
df <- data.frame(sid = c("S1", "S2"), score = c(50, 150))
f <- dcc_findings("S2", variable = "score", check_id = "R001",
                  evidence = "out of range", severity = "fail",
                  dimension = "validity")
res <- dcc_execute(df, f, actions = list(R001 = "set_na"),
                   id_var = "sid")
html <- dcc_report(res, audience = "audit")
substr(html, 1, 60)

Run the code above in your browser using DataLab