library(dplyr, warn.conflicts = FALSE)
dm <- tribble(
~STUDYID, ~DOMAIN, ~USUBJID, ~AGE, ~AGEU,
"PILOT01", "DM", "01-1302", 61, "YEARS",
"PILOT01", "DM", "17-1344", 64, "YEARS"
)
vs <- tribble(
~STUDYID, ~DOMAIN, ~USUBJID, ~VSTESTCD, ~VISIT, ~VSTPT, ~VSSTRESN,
"PILOT01", "VS", "01-1302", "DIABP", "BASELINE", "LYING", 76,
"PILOT01", "VS", "01-1302", "DIABP", "BASELINE", "STANDING", 87,
"PILOT01", "VS", "01-1302", "DIABP", "WEEK 2", "LYING", 71,
"PILOT01", "VS", "01-1302", "DIABP", "WEEK 2", "STANDING", 79,
"PILOT01", "VS", "17-1344", "DIABP", "BASELINE", "LYING", 88,
"PILOT01", "VS", "17-1344", "DIABP", "BASELINE", "STANDING", 86,
"PILOT01", "VS", "17-1344", "DIABP", "WEEK 2", "LYING", 84,
"PILOT01", "VS", "17-1344", "DIABP", "WEEK 2", "STANDING", 82
)
# Merging all dm variables to vs
derive_vars_merged(
vs,
dataset_add = select(dm, -DOMAIN),
by_vars = get_admiral_option("subject_keys")
)
Run the code above in your browser using DataLab