Skip to content
Prev 28313 / 29559 Next

Question on symmetric for nb2mat

Dear all, I think the following message should work. Excuse me for the
previous message.

library(spdep)
library(rgdal)
library(Matrix)

nc_sids <- readOGR(system.file("shapes/sids.shp", package = "spData"))
adj <- poly2nb(nc_sids)
W <- as(nb2mat(adj, style = "B"), "Matrix")
Matrix::isSymmetric(W)
chol(W)

If it's still not working I added a reprex here:
https://gist.github.com/agila5/59d3a173df9b1efabe13800f748a2d48

Kind regards
Andrea


Il giorno mer 29 lug 2020 alle ore 17:19 Roger Bivand <Roger.Bivand at nhh.no>
ha scritto: