Learn R Programming

DCC (version 1.2.1)

dcc_validate_rules: Validate a rule set before it is used

Description

Checks a dcc_rules rule set for structural problems -- unknown types, missing required fields, duplicate or empty IDs -- and returns a structured report. It never evaluates rules against data and never changes anything.

Usage

dcc_validate_rules(rules)

Value

A dcc_validation object: a data.table with code, severity, field, rows (affected row indices, a list column), fix, and optional workbook location fields workbook, sheet, row, column, and cell.

Arguments

rules

A dcc_ruleset from dcc_rules (or the rules element of a dcc_config).

See Also

dcc_validate_data, dcc_doctor.

Examples

Run this code
rf <- tempfile(fileext = ".yaml")
writeLines(c("checks:", "  - id: R001", "    type: range",
             "    min: 0", "    max: 100"), rf)
if (requireNamespace("yaml", quietly = TRUE)) {
  dcc_validate_rules(dcc_rules(rf))
}

Run the code above in your browser using DataLab