Warn if a variable already exists inside a dataset
See also
Function that provide users with custom warnings
suppress_warning()
,
warn_if_incomplete_dtc()
,
warn_if_inconsistent_list()
,
warn_if_invalid_dtc()
Examples
library(dplyr, warn.conflicts = FALSE)
dm <- tribble(
~USUBJID, ~ARM,
"01-701-1015", "Placebo",
"01-701-1016", "Placebo",
)
## No warning as `AAGE` doesn't exist in `dm`
warn_if_vars_exist(dm, "AAGE")
## Issues a warning
warn_if_vars_exist(dm, "ARM")
#> Warning: Variable "ARM" already exists in the dataset.