Quickly calculate spatial autocorrelation on 2D rasters in R