Learn R Programming

sharpshootR (version 2.3)

Moran_I_ByRaster: Compute Moran's I for a raster sampled from a mapunit extent

Description

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

Usage

Moran_I_ByRaster(
  r,
  mu.extent = NULL,
  n = NULL,
  k = NULL,
  do.correlogram = FALSE,
  cor.order = 5,
  crop.raster = TRUE
)

Value

If do.correlogram is TRUE a list with estimated Moran's I ($I) and the correlogram ($correlogram), otherwise the estimated Moran's I value.

Arguments

r

single SpatRaster

mu.extent

SpatVector representation of mapunit polygons bounding box (via terra::ext())

n

number of regular samples (what is a reasonable value?)

k

number of neighbors used for weights matrix

do.correlogram

compute correlogram?

cor.order

order of correlogram

crop.raster

optionally disable cropping of the raster layer

Author

D.E. Beaudette

Details

This function uses the spdep::moran.test() function