bcat_cor_table: UC-branded correlation matrix

View source: R/bcat_cor_table.R

bcat_cor_tableR Documentation

UC-branded correlation matrix

Description

Produce a formatted correlation matrix with significance stars and UC styling. By default shows only the lower triangle.

Usage

bcat_cor_table(
  df,
  method = c("pearson", "spearman", "kendall"),
  full_matrix = FALSE,
  digits = 2,
  stars = TRUE,
  p_threshold = c(0.01, 0.05, 0.1),
  caption = 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 of numeric columns.

method

Character. Correlation method: "pearson" (default), "spearman", or "kendall".

full_matrix

Logical. Show full matrix? Default is FALSE (lower triangle only).

digits

Integer. Decimal places. Default is 2.

stars

Logical. Show significance stars? Default is TRUE.

p_threshold

Numeric vector of p-value thresholds for stars. Default: c(0.01, 0.05, 0.1).

caption

Character. Table caption.

font_size

Numeric. Font size. Default is 12.

header_bg_color

Background color for header.

header_txt_color

Text color for header.

striped

Logical. Zebra striping?

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_fmt_style_table(), bcat_reg_table(), bcat_sum_table()

Examples

bcat_cor_table(mtcars[, c("mpg", "wt", "hp", "disp")])
bcat_cor_table(mtcars[, c("mpg", "wt", "hp")], method = "spearman")

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