Learn R Programming

gtsummary (version 1.2.0)

add_overall: Add column with overall summary statistics

Description

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

Usage

add_overall(x, last = FALSE)

Arguments

x

Object with class tbl_summary from the tbl_summary function

last

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

Value

A tbl_summary object

Example Output

See Also

Other tbl_summary tools: add_n, add_p, add_q.tbl_summary, add_stat_label, bold_italicize_labels_levels, bold_p.tbl_summary, inline_text.tbl_summary, modify_header, sort_p.tbl_summary, tbl_summary

Examples

Run this code
# NOT RUN {
tbl_overall_ex <-
  trial %>%
  dplyr::select(age, response, grade, trt) %>%
  tbl_summary(by = trt) %>%
  add_overall()
# }

Run the code above in your browser using DataLab