View source: R/spatial_weights.R
normalize_adjacency | R Documentation |
This function normalizes an adjacency matrix by dividing each element by the product of the square root of the corresponding row and column sums. Optionally, it can also symmetrize the normalized matrix by averaging it with its transpose.
normalize_adjacency(sm, symmetric = TRUE)
sm |
A sparse adjacency matrix representing the graph. |
symmetric |
A logical value indicating whether to symmetrize the matrix after normalization (default: TRUE). |
A normalized and, if requested, symmetrized adjacency matrix.
A <- matrix(runif(100), 10, 10)
A_normalized <- normalize_adjacency(A)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.