Learn R Programming

DCC (version 1.2.1)

dcc_validate_data: Validate data against a rule set before detection

Description

Checks that a dataset can carry a cleaning run: the record-id column is present, non-missing, and unique, and every variable a rule references exists. It never changes the data.

Usage

dcc_validate_data(data, rules = NULL, id_var = NULL)

Value

A dcc_validation object (see dcc_validate_rules).

Arguments

data

A dcc_data or data.frame.

rules

Optional dcc_ruleset; when supplied, referenced variables are checked against the data columns.

id_var

Optional record-id column to check for presence, missingness, and duplication.

See Also

dcc_validate_rules, dcc_doctor.

Examples

Run this code
df <- data.frame(sid = c("S1", "S1", "S2"), score = c(50, 150, 70))
dcc_validate_data(df, id_var = "sid")

Run the code above in your browser using DataLab