View source: R/lower.tri.vector.R
lower.tri.vector | R Documentation |
Split a matrix into block diagonal sub matrices according to clusters and combine the lower triangular parts into a vector
lower.tri.vector(x, cluster = rep(1, nrow(x)), diag = FALSE)
x |
a square matrix |
cluster |
numeric or factor. Is used to identify the sub-matrices of
|
diag |
logical. Should the diagonal be included? |
Returns a numeric vector containing the elements of the lower triangular sub matrices.
Claus Ekstrom claus@ekstroem.dk
lower.tri
m <- matrix(1:64, ncol=8)
cluster <- c(1, 1, 1, 1, 2, 2, 3, 3)
lower.tri.vector(m, cluster)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.