Elith and Leathwick (2009) recommended the Moran's I to testing for spatial patterns in raw data and residuals. I read many literature regarding this and many packages in R, but could not perform this test. Can anyone help me with detail method in data preparation for Moran's I test for raw dataset and model residual?