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

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

Author

Daniel D. Sjoberg

Examples

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