df_a <- data.frame(
ID = c(1, 1, 2, 3, 4, 5),
day = c(0, 30, 0, 0, 0, 0),
sbp = c(120, 125, 130, NA, 110, 118)
)
df_b <- data.frame(
ID = c(1, 2, 2, 3, 5, 6),
day = c(0, 0, 20, 0, 0, 0),
dbp = c(80, 85, 84, 90, NA, 88)
)
df_c <- data.frame(
ID = c(1, 1, 2, 4, 5, 5),
day = c(0, 40, 0, 0, 0, 10),
bpm = c(70, 72, 68, 75, 77, 79)
)
res <- combine_biomarkers(
data_list = list(df_a, df_b, df_c),
biomarkers = c("sbp", "dbp", "bpm"),
id_col = "ID",
time_col = "day"
)
res$included_ids
head(res$combined_long)
res$presence_summary
Run the code above in your browser using DataLab