Learn R Programming

sdtmchecks (version 1.0.0)

check_ex_exdose_pos_exoccur_no: Check for EXDOSE>0 When EXOCCUR is not "Y"

Description

This checks looks for EXDOSE values greater than 0 when EXOCCUR is not "Y". It could be for a specified drug/treatment, or for all drugs/treatments in the dataset.

Usage

check_ex_exdose_pos_exoccur_no(EX, drug = NULL)

Value

Boolean value for whether the check passed or failed, with 'msg' attribute if the test failed

Arguments

EX

Exposure SDTM dataset with variables USUBJID, EXTRT, EXSTDTC, EXOCCUR and EXDOSE

drug

Drug name for EXTRT; used to subset the dataset. Default value is NULL (i.e. no filtering by drug)

Author

Sara Bodach

Examples

Run this code

EX <- data.frame(
 USUBJID = 1:5,
 EXSTDTC = rep("2017-01-01",5),
 EXTRT   = c(rep("TRT A",2),rep("TRT B",3)),
 EXOCCUR = c(".","", "N", "N", "Y"),
 EXDOSE  = 0:4,
 VISIT = "VISIT 1",
 stringsAsFactors = FALSE
)

check_ex_exdose_pos_exoccur_no(EX)

check_ex_exdose_pos_exoccur_no(EX, drug = "TRT A")
check_ex_exdose_pos_exoccur_no(EX, drug = "TRT B")

EX$EXDOSE = NULL

check_ex_exdose_pos_exoccur_no(EX)

Run the code above in your browser using DataLab