| get_pvals | R Documentation |
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.
get_pvals(X, ...)
X |
A numeric matrix or data frame |
... |
Additional arguments passed to function |
Matrix of p-values
# a matrix of random numbers, 3 cols x <- matrix(runif(30), 10, 3) # get correlations between cols cor(x) # get p values of correlations between cols get_pvals(x)