View source: R/colby_constructors.R
add_colcounts | R Documentation |
Add the data derived column counts.
add_colcounts(lyt, format = "(N=xx)")
lyt |
layout object pre-data used for tabulation |
format |
|
It is often the case that the the column counts derived from the
input data to build_table
is not representative of the population counts.
For example, if events are counted in the table and the header should
display the number of subjects and not the total number of events. In that
case use the col_count
argument in build_table
to control the counts
displayed in the table header.
A PreDataTableLayouts
object suitable for passing to further
layouting functions, and to build_table
.
Gabriel Becker
lyt <- basic_table() %>% split_cols_by("ARM") %>%
add_colcounts() %>%
split_rows_by("RACE", split_fun = drop_split_levels) %>%
analyze("AGE", afun = function(x) list(min = min(x), max = max(x)))
lyt
tbl <- build_table(lyt, DM)
tbl
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.