Learn R Programming

DCC (version 1.2.1)

dcc_doctor: Run every validator over a dataset and rule set

Description

Runs the requested rule, data, and registered-format backend checks and merges their structured reports without changing data or files.

Usage

dcc_doctor(data = NULL, rules = NULL, id_var = NULL, formats = NULL)

Value

A combined dcc_validation object.

Arguments

data

Optional dcc_data or data.frame.

rules

Optional dcc_ruleset from dcc_rules.

id_var

Optional record-id column.

formats

NULL, "all", or registered format names whose installed backends and platform limitations should be checked.

Examples

Run this code
rf <- tempfile(fileext = ".yaml")
writeLines(c("checks:", "  - id: R001", "    type: range",
             "    variable: score", "    min: 0", "    max: 100"), rf)
df <- data.frame(sid = c("S1", "S2"), score = c(50, 70))
if (requireNamespace("yaml", quietly = TRUE)) {
  dcc_doctor(df, dcc_rules(rf), id_var = "sid")
}

Run the code above in your browser using DataLab