listw2sparse | R Documentation |
Edge weights are used in the adjacency matrix. Because most elements of the matrix are 0, using sparse matrix greatly reduces memory use.
listw2sparse(listw)
listw |
A |
A sparse dgCMatrix
, whose row represents each cell or spot and
whose columns represent the neighbors. The matrix does not have to be
symmetric. If region.id
is present in the listw
object, then
it will be the row and column names of the output matrix.
library(SFEData)
sfe <- McKellarMuscleData("small")
g <- findVisiumGraph(sfe)
mat <- listw2sparse(g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.