calculate_spatial_autocorrelation
Source:R/calculate_spatial_autocorrelation.R
calculate_spatial_autocorrelation.Rd
Takes the result of grid_metrics
(a RasterLayer
object) and calculate its spatial autocorrelation.
Arguments
- raster_obj
Raster object in the form of the output of
grid_metrics
.- metric
String. The method for calculating spatial autocorrelation. Choose from "globalmoran" and "GearyC".
Examples
grid <- grid_metrics(SPIAT::defined_image, FUN = calculate_entropy, n_split = 5,
cell_types_of_interest=c("Tumour","Immune3"), feature_colname = "Cell.Type")
calculate_spatial_autocorrelation(grid, metric = "globalmoran")
#> [1] -0.1152657