# \donttest{
# Create sample SDTM DM domains
dm1 <- data.frame(
STUDYID = "STUDY001",
USUBJID = c("SUBJ001", "SUBJ002"),
DMSEQ = c(1, 1),
RACE = c("WHITE", "BLACK OR AFRICAN AMERICAN"),
stringsAsFactors = FALSE
)
dm2 <- data.frame(
STUDYID = "STUDY001",
USUBJID = c("SUBJ001", "SUBJ003"),
DMSEQ = c(1, 1),
RACE = c("WHITE", "ASIAN"),
ETHNIC = c("NOT HISPANIC", "NOT HISPANIC"),
stringsAsFactors = FALSE
)
# Positional matching (default)
result <- cdisc_compare(dm1, dm2, domain = "DM", standard = "SDTM")
# Key-based matching by ID variables
result <- cdisc_compare(dm1, dm2, domain = "DM", id_vars = c("USUBJID"))
names(result)
# }
Run the code above in your browser using DataLab