mysplfun <- make_split_fun(post = list(
add_combo_facet("A_B",
label = "Arms A+B",
levels = c("A: Drug X", "B: Placebo")
),
add_overall_facet("ALL", label = "All Arms")
))
lyt <- basic_table(show_colcounts = TRUE) %>%
split_cols_by("ARM", split_fun = mysplfun) %>%
analyze("AGE")
tbl <- build_table(lyt, DM)
Run the code above in your browser using DataLab