View source: R/sanity_checks.R
edc_warn_patient_diffs | R Documentation |
Compare a subject ID vector to the study's reference subject ID (usually something like enrolres$subjid
), and warn if any patient is missing or extra.
check_subjid()
is the old, deprecated name.
edc_warn_patient_diffs(
x,
ref = getOption("edc_subjid_ref"),
issue_n = "xx",
data_name = NULL,
col_subjid = get_subjid_cols()
)
x |
the subject ID vector to check, or a dataframe which ID column will be guessed |
ref |
the reference for subject ID. Should usually be set through |
issue_n |
identifying row number |
data_name |
the name of the data (for the warning message) |
col_subjid |
name of the subject ID column if |
nothing, called for errors/warnings
tm = edc_example()
load_list(tm)
options(edc_subjid_ref=db0$SUBJID)
#usually, you set something like:
#options(edc_subjid_ref=enrolres$subjid)
edc_warn_patient_diffs(db1)
db1 %>% dplyr::filter(SUBJID>1) %>% edc_warn_patient_diffs()
edc_warn_patient_diffs(c(db1$SUBJID, 99, 999))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.