Skip to contents

Evaluate the conditions in varfmt on df and check whether the format is correctly specified:

  • Are all rows in df used in varfmt?

  • Do all conditions in varfmt match 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?

Usage

check_format(varfmt, df, where = NULL)

Arguments

varfmt

A procr_varformat object with one variable slot.

df

A data.frame to test against.

where

Optional subset expression.

Value

Invisibly returns the input varfmt.

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.