data(sentencing)
C <- shape2mat(sentencing)
nbs <- edges(C)
head(nbs)
## similar to:
head(Matrix::summary(C))
head(Matrix::summary(shape2mat(georgia, "W")))
## add geometry for plotting
library(sf)
E <- edges(C, shape = sentencing)
g1 = st_geometry(E)
g2 = st_geometry(sentencing)
plot(g1, lwd = .2)
plot(g2, add = TRUE)
Run the code above in your browser using DataLab