View source: R/convenience-functions.R
row_standardize | R Documentation |
Row-standardize a matrix; safe for zero row-sums.
row_standardize(C, warn = FALSE, msg = "Row standardizing connectivity matrix")
C |
A matrix |
warn |
Print message |
msg |
A warning message; used internally by geostan. |
A row-standardized matrix, W (i.e., all row sums equal 1, or zero).
A <- shape2mat(georgia)
head(Matrix::summary(A))
Matrix::rowSums(A)
W <- row_standardize(A)
head(Matrix::summary(W))
Matrix::rowSums(W)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.