Checks if two list inputs have the same names and same number of elements and issues a warning otherwise.
See also
Function that provide users with custom warnings
suppress_warning()
,
warn_if_incomplete_dtc()
,
warn_if_invalid_dtc()
,
warn_if_vars_exist()
Examples
library(dplyr, warn.conflicts = FALSE)
library(rlang)
# no warning
warn_if_inconsistent_list(
base = exprs(DTHDOM = "DM", DTHSEQ = DMSEQ),
compare = exprs(DTHDOM = "DM", DTHSEQ = DMSEQ),
list_name = "Test"
)
# warning
warn_if_inconsistent_list(
base = exprs(DTHDOM = "DM", DTHSEQ = DMSEQ, DTHVAR = "text"),
compare = exprs(DTHDOM = "DM", DTHSEQ = DMSEQ),
list_name = "Test"
)
#> Warning: The variables used for traceability in `Test` are not consistent, please check:
#> source 1 , Variables are given as: DTHDOM DTHSEQ DTHVAR
#> source 2 , Variables are given as: DTHDOM DTHSEQ