MAT_half2full | R Documentation |
From a half matrix, recreate a full symmetric matrix. Uses either lower or upper triangle.
MAT_half2full(mat, lower = T, diag = F)
mat |
(matrix) A symmetric matrix |
lower |
(lgl) Whether to use the lower or higher triangle. |
diag |
(lgl) Whether the diagonal values should be included or not. |
A matrix
m = matrix(1:9, ncol=3)
rownames(m) = letters[1:3]
colnames(m) = LETTERS[1:3]
m %>% MAT_half2full
m %>% MAT_half2full(lower=F)
m %>% MAT_half2full(diag=T)
m %>% MAT_half2full(lower=F, diag=T)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.