# example with an error
TR <- data.frame(
USUBJID = c(1,1,2,2),
TRCAT = c(1,1,2,2),
TRTESTCD = c(1,1,2,2),
TRLINKID = c(1,1,2,2),
TRDTC = c(rep("2016-01-01",2), rep("2016-06-01",2)),
TRSTRESC = c(1,1,2,2),
TRSPID = "FORMNAME-R:19/L:19XXXX",
TREVAL = "INVESTIGATOR",
stringsAsFactors = FALSE
)
check_tr_dup(TR)
TR1 <- TR
TR1$TRSPID <- NULL
check_tr_dup(TR1)
TR2 <- TR
TR2$TREVAL <- NULL
check_tr_dup(TR2)
# example with no records flagged because issues only among IRF records
TR3 <- TR
TR3$TREVAL <- "INDEPENDENT ASSESSOR"
check_tr_dup(TR3)
# example with required variable missing
TR4 <- TR
TR4$TRLINKID <- NULL
check_tr_dup(TR4)
Run the code above in your browser using DataLab