sym2long: Convert a symmetric table(short format) to long format

View source: R/mt_extra_1.R

sym2longR Documentation

Convert a symmetric table(short format) to long format

Description

Convert a symmetric table(short format) to long format

Usage

sym2long(x, tri = c("upper", "lower"))

Arguments

x

a symmetric matrix-like data set.

tri

triangular being used.

Value

a data frame of pair-wise comparison.

Examples

co <- cor_tab(mtcars, cor.method = "spearman", adj.method = "BH")
names(co)
corr <- sym2long(co$r, tri = "upper")
pval <- sym2long(t(co$p), tri = "upper")
padj <- sym2long(co$p, tri = "upper")
tmp  <- data.frame(corr, pval, padj)

wanchanglin/mtExtra documentation built on Aug. 2, 2024, 5:47 p.m.