rf <- tempfile(fileext = ".yaml")
writeLines(c("checks:", " - id: R001", " type: range",
" variable: score", " min: 0", " max: 100"), rf)
csv <- tempfile(fileext = ".csv")
writeLines(c("sid,score", "S1,90", "S2,150"), csv)
if (requireNamespace("yaml", quietly = TRUE)) {
cfg <- dcc_config(dcc_rules(rf), actions = list(R001 = "set_na"),
id_var = "sid")
run <- dcc_run(csv, cfg, tempfile("dcc-out"), mode = "preview")
dcc_run_files(run)
}
Run the code above in your browser using DataLab