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.01804801
#> [2,] 0.01804801 1.00000000
cor.pairs(x, cor.method = 'spearman')
#>            [,1]       [,2]
#> [1,] 1.00000000 0.05734173
#> [2,] 0.05734173 1.00000000