new_pairwise_data: Build a pairwise matrix display specification

View source: R/new_pairwise_data.R

new_pairwise_dataR Documentation

Build a pairwise matrix display specification

Description

Constructs a structured spec object consumed by pairwise_matrix(). Always requires var1 and var2 — the pair pattern they encode determines which triangle(s) of the matrix are filled:

Usage

new_pairwise_data(var1, var2, ...)

new_corr_data(var1, var2, ...)

Arguments

var1

Character vector of first variable names per pair.

var2

Character vector of second variable names per pair.

...

Named character vectors of equal length to var1/var2. Each becomes one display row inside the cell (e.g. rho, pval, bf).

Details

Pattern Fills
var1 < var2 Lower triangle only
var1 <= var2 Lower triangle + diagonal
var1 > var2 Upper triangle only
var1 >= var2 Upper triangle + diagonal
var1 != var2 Both triangles, no diagonal
var1 == var2 Full matrix (diag forced to 1)

All additional named vectors become display rows inside each cell, rendered in the order they are supplied.

Value

An object of class pairwise_spec.

Examples

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")
)


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