R/Moran_I_ByRaster.R
Moran_I_ByRaster.Rd
Compute Moran's I using a subset of sample collected within the extent of a mapunit. This is likely an under-estimate of SA because we are including pixels both inside/outside MU delineations
Moran_I_ByRaster(
r,
mu.extent = NULL,
n = NULL,
k = NULL,
do.correlogram = FALSE,
cor.order = 5,
crop.raster = TRUE
)
single SpatRaster
SpatVector
representation of mapunit polygons bounding box (via terra::ext()
)
number of regular samples (what is a reasonable value?)
number of neighbors used for weights matrix
compute correlogram?
order of correlogram
optionally disable cropping of the raster layer
If do.correlogram
is TRUE
a list with estimated Moran's I ($I
) and the correlogram ($correlogram
), otherwise the estimated Moran's I value.
This function uses the spdep::moran.test()
function