add_overall: Add column with overall summary statistics

Description Usage Arguments Value Example Output Author(s) See Also Examples

View source: R/add_overall.R

Description

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

Usage

1
2
3
4
5
6
7
add_overall(x, last, col_label)

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

## S3 method for class '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

Author(s)

Daniel D. Sjoberg

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

1
2
3
4
tbl_overall_ex <-
  trial[c("age", "grade", "trt")] %>%
  tbl_summary(by = trt) %>%
  add_overall()

ddsjoberg/gtsummary documentation built on April 8, 2021, 5:48 a.m.