get_pvals {COINr} | R Documentation |
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, ...)
Arguments
X |
A numeric matrix or data frame |
... |
Additional arguments passed to function |
Value
Matrix of p-values
Examples
# 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)
[Package COINr version 1.1.14 Index]