Learn R Programming

sdtmchecks (version 1.0.0)

check_ds_duplicate_randomization: Check for duplicate randomization records for a patient

Description

Checks for duplicate subject IDs (USUBJID) in the DS domain when randomization is indicated

Usage

check_ds_duplicate_randomization(DS)

Value

boolean value if check failed or passed with 'msg' attribute if the test failed

Arguments

DS

Disposition SDTM dataset with variables USUBJID, DSDECOD

Author

Madeleine Ma

Examples

Run this code

DS <- data.frame(
 USUBJID = c("ID1","ID1","ID2","ID2","ID3","ID3"),
 DSDECOD = c("RANDOMIZATION","OTHER THING","RANDOMIZATION",
             "OTHER THING","RANDOMIZATION","RANDOMIZATION")
             , stringsAsFactors = FALSE
)

check_ds_duplicate_randomization(DS)

DS$DSDECOD <- NULL
check_ds_duplicate_randomization(DS)

Run the code above in your browser using DataLab