# NOT RUN {
lyt <- basic_table() %>%
split_cols_by("ARM") %>%
analyze(c("AGE", "BMRKR2"))
build_table(lyt, ex_adsl)
# Let's look at the splits in more detail
l <- basic_table() %>% split_cols_by("ARM")
l
# add an analysis (summary)
l2 <- l %>%
analyze(c("AGE", "COUNTRY"), afun = list_wrap_x(summary) , format = "xx.xx")
l2
build_table(l2, DM)
# By default sequentially adding layouts results in nesting
library(dplyr)
DM_MF <- DM %>% filter(SEX %in% c("M", "F")) %>% mutate(SEX = droplevels(SEX))
l3 <- basic_table() %>% split_cols_by("ARM") %>%
split_cols_by("SEX") %>%
analyze(c("AGE", "COUNTRY"), afun = list_wrap_x(summary), format = "xx.xx")
l3
build_table(l3, DM_MF)
# nested=TRUE vs not
l4 <- basic_table() %>% split_cols_by("ARM") %>%
split_rows_by("SEX", split_fun = drop_split_levels) %>%
split_rows_by("RACE", split_fun = drop_split_levels) %>%
analyze("AGE")
l4
build_table(l4, DM)
l5 <- basic_table() %>% split_cols_by("ARM") %>%
split_rows_by("SEX", split_fun= drop_split_levels) %>%
analyze("AGE") %>%
split_rows_by("RACE", nested=FALSE, split_fun = drop_split_levels) %>%
analyze("AGE")
l5
build_table(l5, DM)
# }
Run the code above in your browser using DataLab