safe_prune_table {junco} | R Documentation |
Safely Prune Table With Empty Table Message If Needed
Description
Safely Prune Table With Empty Table Message If Needed
Usage
safe_prune_table(
tt,
prune_func = prune_empty_level,
stop_depth = NA,
empty_msg = " - No Data To Display - ",
spancols = FALSE
)
Arguments
tt |
( |
prune_func |
( |
stop_depth |
( |
empty_msg |
character(1). The message to place in the table if no rows were left after pruning |
spancols |
logical(1). Should |
Value
tt
pruned based on the arguments, or, if
pruning would remove all rows, a TableTree with the
same column structure, and one row containing the
empty message spanning all columns
Examples
prfun <- function(tt) TRUE
lyt <- basic_table() |>
split_cols_by("ARM") |>
split_cols_by("STRATA1") |>
split_rows_by("SEX") |>
analyze("AGE")
tbl <- build_table(lyt, ex_adsl)
safe_prune_table(tbl, prfun)