gtsummary (version 1.3.6)

add_overall: Add column with overall summary statistics

Description

Adds a column with overall summary statistics to tables created by tbl_summary or tbl_svysummary.

Usage

add_overall(x, last, col_label)

# S3 method for tbl_summary add_overall(x, last = FALSE, col_label = NULL)

# S3 method for tbl_svysummary add_overall(x, last = FALSE, col_label = NULL)

Arguments

x

Object with class tbl_summary from the tbl_summary function or object with class tbl_svysummary from the tbl_svysummary function.

last

Logical indicator to display overall column last in table. Default is FALSE, which will display overall column first.

col_label

String indicating the column label. Default is "**Overall**, N = {N}"

Value

A tbl_summary object or a tbl_svysummary object

Example Output

See Also

Other tbl_summary tools: add_n.tbl_summary(), add_p.tbl_summary(), add_q(), add_stat_label(), bold_italicize_labels_levels, inline_text.tbl_summary(), inline_text.tbl_survfit(), modify, tbl_merge(), tbl_stack(), tbl_summary()

Other tbl_svysummary tools: add_n.tbl_summary(), add_p.tbl_svysummary(), add_q(), add_stat_label(), modify, tbl_merge(), tbl_stack(), tbl_svysummary()

Examples

Run this code
# NOT RUN {
tbl_overall_ex <-
  trial[c("age", "grade", "trt")] %>%
  tbl_summary(by = trt) %>%
  add_overall()
# }

Run the code above in your browser using DataCamp Workspace