df <- data.frame(sid = c("S1", "S2"), score = c(50, 150))
f <- tempfile(fileext = ".yaml")
writeLines(c(
"checks:",
" - id: R001",
" type: range",
" variable: score",
" min: 0",
" max: 100"
), f)
if (requireNamespace("yaml", quietly = TRUE)) {
dcc_detect(df, dcc_rules(f), id_var = "sid")
}
Run the code above in your browser using DataLab