extractCorr | R Documentation |
Extracting correlations from a covariance matrix
extractCorr(mat)
mat |
A covariance matrix. |
The correlation matrix embedded in mat
.
# 2 dimensional case
d <- 2
tmp <- matrix(rnorm(d^2), d, d)
mcov <- tcrossprod(tmp, tmp)
# Covariance matrix
mcov
# Correlation matrix
extractCorr(mcov)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.