assert_no_duplicate {EDCimport} | R Documentation |
Assert that a dataset has one row per patient
Description
Check that there is no duplicate on the column holding patient ID in a pipeable style.
Mostly useful after joining two datasets.
Usage
assert_no_duplicate(df, id_col = get_key_cols())
Arguments
df |
the dataset |
id_col |
(optional) the name of the columns holding patient ID |
Value
the df
dataset, unchanged
Examples
#without duplicate => no error, continue the pipeline
tibble(subjid=c(1:10)) %>% assert_no_duplicate() %>% nrow()
#with duplicate => throws an error
#tibble(subjid=c(1:10, 1:2)) %>% assert_no_duplicate() %>% nrow()
[Package EDCimport version 0.4.1 Index]