powered by
Checks if a dataset confirms to a given set of rules
check_data( x, rules, xname = deparse(substitute(x)), stop_on_fail = FALSE, stop_on_warn = FALSE, stop_on_error = FALSE )
a data.frame-like object with one row for each rule and its results
a dataset, either a data.frame, dplyr::tibble, data.table::data.table, arrow::arrow_table, arrow::open_dataset, or dplyr::tbl (SQL connection)
data.frame
dplyr::tibble
data.table::data.table
arrow::arrow_table
arrow::open_dataset
dplyr::tbl
a list of rules
rule
optional, a name for the x variable (only used for errors)
when any of the rules fail, throw an error with stop
when a warning is found in the code execution, throw an error with stop
when an error is found in the code execution, throw an error with stop
detect_backend()
rs <- ruleset( rule(mpg > 10), rule(cyl %in% c(4, 6)), # missing 8 rule(qsec >= 14.5 & qsec <= 22.9) ) rs check_data(mtcars, rs)
Run the code above in your browser using DataLab