These functions check to see if values (e.g labels, formats) that should be consistent for a variable across all data are actually consistent.
check_inconsistent_labels(metacore)
check_inconsistent_types(metacore)
check_inconsistent_formats(metacore)
metacore object to check
If all variables are consistent it will return a message. If there are inconsistencies it will return a message and a dataset of the variables with inconsistencies.
## EXAMPLE WITH DUPLICATES
# Loads in a metacore obj called metacore
load(metacore_example("pilot_ADaM.rda"))
check_inconsistent_labels(metacore)
#> Mismatch labels detected
#> # A tibble: 9 × 4
#> variable label n_vars ls_of_vars
#> <chr> <chr> <int> <list>
#> 1 ABLFL ABLFL 1 <chr [1]>
#> 2 ABLFL Analysis Baseline Flag 1 <chr [1]>
#> 3 ABLFL Baseline Record Flag 6 <chr [6]>
#> 4 ANL01FL Analysis Flag 01 5 <chr [5]>
#> 5 ANL01FL Analysis Record Flag 01 3 <chr [3]>
#> 6 CHG Baseline Value 1 <chr [1]>
#> 7 CHG Change from Baseline 6 <chr [6]>
#> 8 ITTFL Intent-To-Treat Population Flag 1 <chr [1]>
#> 9 ITTFL Intent-to-Treat Population Flag 3 <chr [3]>
check_inconsistent_types(metacore)
#> Mismatch types detected
#> # A tibble: 8 × 4
#> variable type n_vars ls_of_vars
#> <chr> <chr> <int> <list>
#> 1 AVAL float 6 <chr [6]>
#> 2 AVAL integer 4 <chr [4]>
#> 3 BASE float 6 <chr [6]>
#> 4 BASE integer 2 <chr [2]>
#> 5 CHG float 5 <chr [5]>
#> 6 CHG integer 2 <chr [2]>
#> 7 PCHG float 1 <chr [1]>
#> 8 PCHG integer 2 <chr [2]>
## EXAMPLE WITHOUT DUPLICATES
# Loads in a metacore obj called metacore
load(metacore_example("pilot_SDTM.rda"))
check_inconsistent_labels(metacore)
#> No mismatch labels detected
check_inconsistent_formats(metacore)
#> No mismatch formats detected
check_inconsistent_types(metacore)
#> No mismatch types detected