warn_if_inconsistent_list | R Documentation |
Checks if two list inputs have the same names and same number of elements and issues a warning otherwise.
warn_if_inconsistent_list(base, compare, list_name, i = 2)
base |
A named list
|
compare |
A named list
|
list_name |
A string the name of the list
|
i |
the index id to compare the 2 lists
|
a warning
if the 2 lists have different names or length
Function that provide users with custom warnings
suppress_warning()
,
warn_if_incomplete_dtc()
,
warn_if_invalid_dtc()
,
warn_if_vars_exist()
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"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.