[R-sig-Geo] Question on symmetric for nb2mat
Andrea Gilardi
@@g||@rd|5 @end|ng |rom c@mpu@@un|m|b@|t
Wed Jul 29 17:09:08 CEST 2020
Dear all, probably I'm missing something obvious but I have a question on
the matrix built using nb2mat with argument style = "B". More precisely, I
don't understand why the following code says that the matrix *W* (which
should be a binary first-order adjacency matrix) is not symmetric:
*library(spdep)library(rgdal)library(Matrix)# datanc.sids <-
readOGR(system.file("shapes/sids.shp", package = "spData"))adj <-
poly2nb(nc.sids)W <- as(nb2mat(adj, style = "B"),
"Matrix")Matrix::isSymmetric(W)#> [1] FALSEchol(W)#> Error in
asMethod(object): not a symmetric matrix; consider forceSymmetric() or
symmpart()*
Kind regards
Andrea
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list