[R-sig-Geo] Neighborhood matrix from poly2nb (spdep package)

Maaz Gardezi maaz at iastate.edu
Fri Nov 4 14:12:06 CET 2016


Hi,

I'm trying to extract the 'neighborhood matrix' from the poly2nb function.

I can see the neighbors for each polygon, e.g. 1 has neighbors 2, 3, 5, 6.

I try to convert this matrix into a data frame but get the error "cannot
coerce class ""nb"" to a data.frame". Is there any way of doing this in the
spdep package?

Other possible ways?

Regards,

Maaz

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list