calc.maxcor | R Documentation |
Calculates the maximum absolute correlation between two matrices along the columns
calc.maxcor(x1, x2)
x1 |
Named matrix 1 |
x2 |
Named matrix 2 |
This function calculates the maximum absolute correlation for each column of
x2
against each column of x1
. The matrices are named and if
the names overlap between x1
and x2
, the correlation between
the same named entries is set to zero.
A vector of maximum absolute correlations
x1 <- matrix(rnorm(500), 100, 5) x2 <- x1 + matrix(rnorm(500), 100, 5) colnames(x1) <- c("A", "B", "C", "D", "E") colnames(x2) <- c("A", "B", "C", "D", "E") cor(x1, x2) calc.maxcor(x1, x2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.