poly2nb
poly2nb is a function in the spdep package for R that constructs a neighbor list (an object of class nb) representing contiguity-based adjacency among polygonal features. It takes a SpatialPolygons or SpatialPolygonsDataFrame object (from the sp package) and returns, for each polygon, the indices of neighboring polygons.
Adjacency is defined by contiguity between polygons. By default, poly2nb uses rook contiguity, where two polygons
The function accepts optional arguments to control labeling and handling of geometries, and it relies on topological
Typical uses include creating neighborhood structures for regional analysis, spatial autocorrelation studies, and various spatial regression