powered by
Interface between Matrix class objects and weights list
listw2dgCMatrix(listw, zero.policy = NULL)
Matrix class object: a sparse Matrix
a listw object created for example by spdep::nb2listw
listw
spdep::nb2listw
See lagsarlm for details
lagsarlm
Gianfranco Piras
data(columbus, package="spdep") listw<-spdep::nb2listw(col.gal.nb) spW<-listw2dgCMatrix(listw)
Run the code above in your browser using DataLab