The example from the documentation for nbdists() uses two predefined objects (columbus and col.gal.nb), so it's not clear to me how coordinates are being matched (see below)
library(spdep) example(columbus) coords <- coordinates(columbus) dlist <- nbdists(col.gal.nb, coords) Does nbdists() match coordinates via location or row name? Or does it rely on the ordering of the objects? What I would like to do is go from a SpatialPolygonsDataFrame to neighbourslist to nbdist as follows: nb = poly2nb(columbus, row.names = columbus$COLUMBUS_I, queen = FALSE) nbdist = nbdists(nb, coords = coordinates(columbus), longlat = TRUE) Is this reliable? This question would apply similarly to any neighbours list function with a coords parameter, e.g. plot.nb or nb2lines. Thanks, --Lee -- Lee Hachadoorian PhD Student, Geography Program in Earth & Environmental Sciences CUNY Graduate Center _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo