expand_matrix | R Documentation |
Expand Matrix
expand_matrix(A, label = NULL, loops = FALSE, normalize = FALSE)
A |
A square matrix |
label |
Duplicated labels to expand the matrix |
loops |
Whether the loops are retained or not |
normalize |
Whether to normalize the matrix considering the fractional counting per group |
Return an expanded matrix
Alejandro Espinosa-Rada
A <- matrix(c(
0, 1, 1,
0, 0, 1,
1, 0, 0
), byrow = TRUE, ncol = 3, nrow = 3)
rownames(A) <- letters[1:NROW(A)]
colnames(A) <- rownames(A)
label <- sort(rep(rownames(A), 2))
expand_matrix(A, label, loops = FALSE, normalize = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.