add_overall_level {rtables} | R Documentation |
Add a virtual "overall" level to split
Description
Add a virtual "overall" level to split
Usage
add_overall_level(
valname = "Overall",
label = valname,
extra_args = list(),
first = TRUE,
trim = FALSE
)
Arguments
valname |
( |
label |
( |
extra_args |
( |
first |
( |
trim |
( |
Value
A closure suitable for use as a splitting function (splfun
) when creating a table layout.
Examples
lyt <- basic_table() %>%
split_cols_by("ARM", split_fun = add_overall_level("All Patients",
first = FALSE
)) %>%
analyze("AGE")
tbl <- build_table(lyt, DM)
tbl
lyt2 <- basic_table() %>%
split_cols_by("ARM") %>%
split_rows_by("RACE",
split_fun = add_overall_level("All Ethnicities")
) %>%
summarize_row_groups(label_fstr = "%s (n)") %>%
analyze("AGE")
lyt2
tbl2 <- build_table(lyt2, DM)
tbl2
[Package rtables version 0.6.9 Index]