pairwise_matrix: Display a Pairwise Matrix Table in the Console

View source: R/table-pairwise_matrix.R

pairwise_matrixR Documentation

Display a Pairwise Matrix Table in the Console

Description

Display a Pairwise Matrix Table in the Console

Usage

pairwise_matrix(
  display,
  title = NULL,
  name = "Pairwise Matrix",
  diag_1 = TRUE,
  digits = 3,
  layout_view = FALSE,
  layout_center = FALSE,
  center_table = FALSE,
  border_char = getOption("tab_default")$border_char,
  style = list(),
  ...
)

corr_matrix(
  display,
  title = NULL,
  diag_1 = TRUE,
  digits = 3,
  layout_view = FALSE,
  layout_center = FALSE,
  center_table = FALSE,
  border_char = getOption("tab_default")$border_char,
  style = list(),
  ...
)

Arguments

display

A pairwise_spec object from new_pairwise_data(), or a plain symmetric matrix (e.g. from cor()).

title

Label shown above the table. Auto-detected from a title attribute on the spec if present; falls back to name.

name

Short name used in the layout legend box header. Default "Pairwise Matrix".

diag_1

If TRUE, diagonal cells always show "1". Default TRUE.

digits

Decimal places for numeric formatting. Default 3.

layout_view

Show a layout legend box above the table? Default FALSE.

layout_center

Center the layout box in the terminal? Default FALSE.

center_table

Center table in terminal? Default FALSE.

border_char

Border character. Default from getOption("tab_default").

style

A style list. Keys match the extra field names passed to new_pairwise_data() (e.g. rho, pval, bf), plus title and border_text.

...

Reserved for future use.

Value

Invisibly returns the rendered character matrix.

Examples

# From a plain correlation matrix
pairwise_matrix(cor(mtcars[, 1:4]), title = "Pearson Correlation Matrix")

# Customizable example
spec = new_pairwise_data(
    var1 = c("a", "a", "b"),
    var2 = c("b", "c", "c"),
    rho = c("0.89", "0.79", "0.66"),
    pval = c("<0.001", "<0.001", "<0.001")
)
pairwise_matrix(spec, title = "Pearson Correlation Matrix", layout_view = TRUE)


tabstats documentation built on July 8, 2026, 5:07 p.m.