Validation on rows
Usage
validate_rows(
data,
row_reduction_fn,
predicate,
...,
obligatory = FALSE,
description = NA,
skip_chain_opts = FALSE,
success_fun = assertr::success_append,
error_fun = assertr::error_append,
defect_fun = assertr::defect_append
)Arguments
- data
A data.frame or tibble to test
- row_reduction_fn
Function that should reduce rows into a single column that is passed to validation e.g.
num_row_NAs- predicate
Predicate function or predicate generator such as
in_setorwithin_n_sds- ...
Columns selection that
row_reduction_fnshould be called on. All tidyselectlanguagemethods are supported. If not provided, alleverythingwill be used.- obligatory
If TRUE and assertion failed the data is marked as defective. For defective data, all the following rules are handled by defect_fun function
- description
A character string with description of assertion. The description is then displayed in the validation report
- skip_chain_opts
While wrapping data with validate function,
success_funanderror_funparameters are rewritten withsuccess_appendanderror_appendrespectively. In order to use parameters assigned to the function directly set skip_chain_opts to TRUE.- success_fun
Function that is called when the validation pass
- error_fun
Function that is called when the validation fails
- defect_fun
Function that is called when the data is marked as defective