Moran's I is a diagnostic statistic that can be used to detect spatial autocorrelation in the residuals of a regression, given that you have a weight matrix $\mathbf{w}$, with entries $w_{ij}$ representing distances between observation (residuals) $X_i$ and $X_j$. You can think of it as a spatially-weighted measure of correlation. Significance of the statistic can be calculated analytically or perhaps with non-parametric re-sampling methods (e.g. jackknife). Another method for doing something similar is the Lagrange multiplier test.
If a statistically significant autocorrelation is detected in the residuals, physically proximal observations have to be included in the regression model, similar in vein to what is done in a time-series.
Luckily, for the R user, there is an Analysis of Spatial Data CRAN task view; one recommend package is the spdep, which has the requisite functions (and illustrative vignettes).