Fast estimation of pairwise correlation coefficients.

cor.pairs(emat, cor.method = c("pearson", "spearman"))

Arguments

emat

a numeric matrix

cor.method

a character, specifying the method to use for estimation. Possible values are 'pearson' (default) and 'spearman'

Value

a numeric matrix with estimated correlation coefficients

Examples

x <- matrix(rnorm(200), 100, 2) cor.pairs(x)
#> [,1] [,2] #> [1,] 1.00000000 -0.02677797 #> [2,] -0.02677797 1.00000000
cor.pairs(x, cor.method = 'spearman')
#> [,1] [,2] #> [1,] 1.0000000 -0.0520492 #> [2,] -0.0520492 1.0000000