Please visit https://www.jstor.org/stable/3683177?seq=1 for understanding the concept of autocorrelation in detail. You can read it online for free.
Koenig, Walter D., and Johannes M. H. Knops. "Testing for Spatial Autocorrelation in Ecological Studies." Ecography 21, no. 4 (1998): 423-29. www.jstor.org/stable/3683177.
In the context of R, spind package may be of use. You may find more details about it here Article spind: an R Package to Account for Spatial Autocorrelation i...