View source: R/adjust_mat_pval.R
adjust_mat_pval | R Documentation |
Adjust matrix of p-values for multiple correction. Helpful for correlation matrices.
adjust_mat_pval(mat, method = "BH", out_type = "matrix")
mat |
numeric matrix |
method |
multiple testing correction method. default 'BH' |
out_type |
'matrix' or 'dataframe'. matrix returns symmetrical matrix. dataframe returns long dataframe |
Adjusted p-values as either matrix (default) or long data.frame
# 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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.