td <- tempdir()
dev_dir <- file.path(td, "dev")
val_dir <- file.path(td, "val")
rpt_dir <- file.path(td, "rpt")
dir.create(dev_dir, showWarnings = FALSE)
dir.create(val_dir, showWarnings = FALSE)
dir.create(rpt_dir, showWarnings = FALSE)
dev <- data.frame(
STUDYID = "STDY1",
USUBJID = c("01", "02"),
AESEQ = c(1, 1),
AETERM = c("HEADACHE", "NAUSEA"),
stringsAsFactors = FALSE
)
val <- dev
val$AETERM[2] <- "VOMITING"
utils::write.csv(dev, file.path(dev_dir, "adae.csv"), row.names = FALSE)
utils::write.csv(val, file.path(val_dir, "v-adae.csv"), row.names = FALSE)
generate_compare_report(
domain = "adae",
dev_dir = dev_dir,
val_dir = val_dir,
by_vars = c("STUDYID","USUBJID","AESEQ"),
report_dir = rpt_dir,
write_csv = TRUE,
run_comparedf = FALSE
)
generate_compare_report(
domain = "ADAE",
dev_dir = dev_dir,
val_dir = val_dir,
by_vars = c("STUDYID","USUBJID","AESEQ"),
report_dir = rpt_dir,
write_csv = FALSE,
run_comparedf = FALSE
)
generate_compare_report(
domain = "adae",
dev_dir = dev_dir,
val_dir = val_dir,
by_vars = c("STUDYID","USUBJID","AESEQ"),
report_dir = rpt_dir,
filter_expr = "USUBJID == '02'",
write_csv = TRUE,
run_comparedf = FALSE
)
Run the code above in your browser using DataLab