ADSL <- ex_adsl
lyt <- basic_table() |>
split_cols_by("ARM") |>
split_rows_by("STRATA1") |>
analyze(vars = "AGE", afun = function(x) {
in_rows(
"Mean (sd)" = rcell(c(mean(x), sd(x)), format = "xx.xx (xx.xx)")
)
}) |>
insert_blank_line() |>
analyze(vars = "AGE", table_names = "AGE_Range", afun = function(x) {
in_rows(
"Range" = rcell(range(x), format = "xx.xx - xx.xx")
)
})
build_table(lyt, ADSL)
Run the code above in your browser using DataLab