Compare a subject ID vector to the study's reference subject ID (usually something like enrolres$subjid
). check_subjid()
is the old, deprecated name.
Usage
assert_no_missing_patient(x, ref = getOption("edc_subjid_ref"))
Arguments
- x
the subject ID column to check, or a dataframe which ID column will be guessed
- ref
the reference for subject ID. Should usually be set through
edc_options(edc_subjid_ref=xxx)
. See example.
Examples
tm = edc_example()
#> Warning: Option "edc_lookup" has been overwritten.
load_list(tm)
options(edc_subjid_ref=db0$SUBJID)
#usually, you set something like:
#options(edc_subjid_ref=enrolres$subjid)
assert_no_missing_patient(db1)
db1 %>% dplyr::filter(SUBJID>1) %>% assert_no_missing_patient()
#> Warning: Missing 1 subject ID in `.`: 1
assert_no_missing_patient(c(db1$SUBJID, 99, 999))
#> Warning: Additional 2 subjects ID in `c(db1$SUBJID, 99, 999)`: 99 and 999