Check coverage and consistency of a varformat on a data.frame
Source: R/varformat_check.R
check_format.RdEvaluate the conditions in varfmt on df and check whether the format is
correctly specified:
Are all rows in
dfused invarfmt?Do all conditions in
varfmtmatch to at least one row?Are subsets that were declared as 'disjoint' in fact disjoint?
Are subsets that were declared as not 'disjoint' in fact overlapping?
Are subsets that were declared as 'exhaustive' in fact exhaustive?
Are subsets that were declared as not 'exhaustive' in fact not exhaustive?
Examples
ecostat_f <- new_format_asis(eusilc, ecoStat, include_na = TRUE)
check_format(ecostat_f, eusilc)
#> ✔ `ecoStat` [ck_allrows] All rows used.
#> ✔ `ecoStat` [ck_allconds] All conditions used.
#> ✔ `ecoStat` [ck_disjoint] Disjoint subsets verified.
#> ✔ `ecoStat` [ck_overlap] Overlapping subsets verified.
#> ✔ `ecoStat` [ck_exhaustive] Exhaustive subsets verified.
#> ✔ `ecoStat` [ck_incomplete] Non-exhaustive subsets verified.