| audit_cols_minimal {scrutiny} | R Documentation |
Compute minimal audit() summaries
Description
Call audit_cols_minimal() within your audit() methods for
the output of consistency test mapper functions such as grim_map(). It
will create a tibble with the three minimal, required columns:
-
incons_casescounts the inconsistent cases, i.e., the number of rows in the mapper's output where"consistency"isFALSE. -
all_casesis the total number of rows in the mapper's output. -
incons_rateis the ratio ofincons_casestoall_cases.
You can still add other columns to this tibble. Either way, make sure to name your method correctly. See examples.
Usage
audit_cols_minimal(data, name_test)
Arguments
data |
Data frame returned by a mapper function, such as |
name_test |
String (length 1). Short, plain-text name of the consistency
test, such as |
Value
A tibble (data frame) with the columns listed above.
See Also
For context, see vignette("consistency-tests-in-depth"). In case
you don't call audit_cols_minimal(), you should call
check_audit_special().
Examples
# For a mapper function called `schlim_map()`
# that applies a test called SCHLIM and returns
# a data frame with the `"scr_schlim_map"` class:
audit.scr_schlim_map <- function(data) {
audit_cols_minimal(data, name_test = "SCHLIM")
}
# If you like, add other summary columns
# with `dplyr::mutate()` or similar.