get_pvals: P-values for correlations in a data frame or matrix
Description
This is a stripped down version of the "cor.mtest()" function from the "corrplot" package. It uses
the stats::cor.test() function to calculate pairwise p-values. Unlike the corrplot version, this
only calculates p-values, and not confidence intervals. Credit to corrplot for this code, I only
replicate it here to avoid depending on their package for a single function.
Usage
get_pvals(X, ...)
Value
Matrix of p-values
Arguments
X
A numeric matrix or data frame
...
Additional arguments passed to function cor.test(), e.g. conf.level = 0.95.
# a matrix of random numbers, 3 colsx <- matrix(runif(30), 10, 3)
# get correlations between colscor(x)
# get p values of correlations between colsget_pvals(x)