adjust_mat_pval: adjust_mat_pval

View source: R/adjust_mat_pval.R

adjust_mat_pvalR Documentation

adjust_mat_pval

Description

Adjust matrix of p-values for multiple correction. Helpful for correlation matrices.

Usage

adjust_mat_pval(mat, method = "BH", out_type = "matrix")

Arguments

mat

numeric matrix

method

multiple testing correction method. default 'BH'

out_type

'matrix' or 'dataframe'. matrix returns symmetrical matrix. dataframe returns long dataframe

Value

Adjusted p-values as either matrix (default) or long data.frame

Examples

# load example data
data(dss_example)

# subset features, features in columns
feat_mat <- dss_example$merged_abundance_id[1:6,2:26]
rownames(feat_mat) <- dss_example$merged_abundance_id[1:6,1]
feat_mat <- t(feat_mat)

# correlation matrix
corr_result <- psych::corr.test(feat_mat)

adjust_mat_pval(corr_result$p)
adjust_mat_pval(corr_result$p, out_type='dataframe')

OxfordCMS/OCMSutility documentation built on Feb. 27, 2025, 8:19 p.m.