Skip to contents

Database issues should be traced in a separate table file, with an identifying row number.

Usage

edc_data_warn(
  df,
  message,
  ...,
  issue_n = NULL,
  max_subjid = 5,
  col_subjid = get_subjid_cols()
)

edc_data_stop(
  df,
  message,
  ...,
  issue_n = NULL,
  max_subjid = 5,
  col_subjid = get_subjid_cols()
)

Arguments

df

the filtered dataframe

message

the message. Can use cli formats.

...

unused

issue_n

(optional) identifying row number

max_subjid

max number of subject ID to show in the message

col_subjid

column name for subject ID. Set to NULL to ignore.

Value

df invisibly

Examples

tm = edc_example_mixed()
#> Warning: Option "edc_lookup" has been overwritten.
a = tm$long_pure %>% dplyr::filter(val1a>2)
edc_data_warn(a, "{.val val1} should be lesser than 2", issue_n=1)
#> Warning: Issue #01: "val1" should be lesser than 2 (9 patients: #2, #4, #16, #29, #32,
#> …)
edc_data_warn(a, "{.val val1} should be lesser than 2", issue_n=1, col_subjid=NULL)
#> Warning: Issue #01: "val1" should be lesser than 2
if (FALSE) {
edc_data_stop(a, "{.val val1} should *really* be lesser than 2", issue_n=2)
}