summarize_row_counts {junco}R Documentation

Layout Creating Function Adding Row Counts

Description

This is a simple wrapper of rtables::summarize_row_groups() and the main additional value is that we can choose whether we want to use the alternative (usually ADSL) data set for the counts (default) or use the original data set.

Usage

summarize_row_counts(lyt, label_fstr = "%s", alt_counts = TRUE)

Arguments

lyt

(layout)
input layout where analyses will be added to.

label_fstr

(string)
a sprintf style format string. It can contain up to one ⁠%s⁠ which takes the current split value and generates the row label.

alt_counts

(flag)
whether row counts should be taken from alt_counts_df (TRUE) or from df (FALSE).

Value

A modified layout where the latest row split now has a row group summaries (as created by rtables::summarize_row_groups for the counts. for the counts.

Examples

basic_table() |>
  split_cols_by("ARM") |>
  add_colcounts() |>
  split_rows_by("RACE", split_fun = drop_split_levels) |>
  summarize_row_counts(label_fstr = "RACE value - %s") |>
  analyze("AGE", afun = list_wrap_x(summary), format = "xx.xx") |>
  build_table(DM, alt_counts_df = rbind(DM, DM))


[Package junco version 0.1.1 Index]