bcat_sum_table: UC-branded summary statistics table

View source: R/bcat_sum_table.R

bcat_sum_tableR Documentation

UC-branded summary statistics table

Description

Produce a descriptive statistics table with UC styling. Displays mean, SD, min, median, max, N, and percent missing for numeric columns.

Usage

bcat_sum_table(
  df,
  by = NULL,
  stats = c("mean", "sd", "min", "median", "max", "n", "pct_missing"),
  digits = 2,
  caption = NULL,
  footer = NULL,
  font_size = 12,
  header_bg_color = palette_UC[["UC Red"]],
  header_txt_color = palette_UC[["White"]],
  striped = TRUE,
  doc_type = NULL,
  ...
)

Arguments

df

A data frame, tibble, or data.table.

by

Character. Column name for grouped summaries. Default is NULL.

stats

Character vector of statistics to compute. Default includes all.

digits

Integer. Number of decimal places. Default is 2.

caption

Character. Table caption.

footer

Character. Table footnote.

font_size

Numeric. Font size. Default is 12.

header_bg_color

Background color for header. Default is UC Red.

header_txt_color

Text color for header. Default is white.

striped

Logical. Zebra striping? Default is TRUE.

doc_type

Character. Force output format. Auto-detected if NULL.

...

Additional arguments passed to table formatting.

Value

A formatted table object.

Author(s)

Saannidhya Rawat

See Also

Other tables: bcat_cor_table(), bcat_fmt_style_table(), bcat_reg_table()

Examples

bcat_sum_table(mtcars[, c("mpg", "wt", "hp")])
bcat_sum_table(mtcars[, c("mpg", "wt", "cyl")], by = "cyl")

Rbearcat documentation built on March 21, 2026, 5:07 p.m.