powered by
Normalise a square matrix by dividing elements by the sum of off-diagonal entries row-wise. Note: sets diagonal to zero.
row_normalised(adj, keep_values = FALSE)
Adjacency matrix to normalise
Whether to keep off-diagonal values or normalise fully (defaults to FALSE).
FALSE
A matrix based on adj with zero diagonals and off-diagonal elements sum to one.
adj
# NOT RUN { d <- 5 adj <- matrix(1, d, d) row_normalised(adj) # }
Run the code above in your browser using DataLab