A function to compute the contiguity matrix
The function is based on rgdal and spdep packages and can be used with a shape file or an R spatial object (SpatialPolygonsDataFrame).
- a spatial object (SpatialPolygonsDataFrame) containing geographic information
- a character vector with the folder (directory) name indicating where the shapefile with the geographic information is located.
- a character vector with the name of the shapefile (without the .shp extension) which contains the geographic information
= TRUE (by default) for queen criteria, FALSE for rook criteria
A first order contiguity (adjacency) matrix, where each element [i,j] equals 1 if i-th and j-th spatial units are adjacent, 0 otherwise (queen or rook criteria)
Other spatial functions used for segregation indices
1 2 3 4