add_rowcounts {tern} | R Documentation |
Layout-creating function to add row total counts
Description
This works analogously to rtables::add_colcounts()
but on the rows. This function
is a wrapper for rtables::summarize_row_groups()
.
Usage
add_rowcounts(lyt, alt_counts = FALSE)
Arguments
lyt |
( |
alt_counts |
( |
Value
A modified layout where the latest row split labels now have the row-wise total counts (i.e. without column-based subsetting) attached in parentheses.
Note
Row count values are contained in these row count rows but are not displayed so that they are not considered zero rows by default when pruning.
Examples
basic_table() %>%
split_cols_by("ARM") %>%
add_colcounts() %>%
split_rows_by("RACE", split_fun = drop_split_levels) %>%
add_rowcounts() %>%
analyze("AGE", afun = list_wrap_x(summary), format = "xx.xx") %>%
build_table(DM)
[Package tern version 0.9.5 Index]