Learn R Programming

DCC (version 1.2.1)

dcc_trace: Trace the cleaning history of a record or cell

Description

Reverse lookup from the cleaned data back through the pipeline: all findings and all logged changes for one record, optionally narrowed to one cell. This implements the auditable-reporting requirement that any cell in the final dataset can be traced to its cleaning history.

Usage

dcc_trace(x, record_id, variable = NULL)

Value

A dcc_trace object: list with record_id, variable, findings (matching findings rows) and changes (matching audit rows).

Arguments

x

A dcc_result from dcc_execute.

record_id

Record identifier (as used in the findings).

variable

Optional variable name to narrow the trace to a single cell.

Examples

Run this code
df <- data.frame(sid = "S1", q1 = 9)
f <- dcc_findings("S1", variable = "q1", check_id = "C",
                  evidence = "legacy code")
res <- dcc_execute(df, f, actions = list(C = "set_na"), id_var = "sid")
dcc_trace(res, "S1", "q1")

Run the code above in your browser using DataLab