# \donttest{
library(sf)
library(spdep)
library(dplyr)
#Load and prepare spatial data
mapdata <- st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
mapdata <- st_make_valid(mapdata)
#Variable to analyze
values <- rnorm(nrow(mapdata))
#Run function
result <- compute_spatial_autocorr(mapdata, values, signif = 0.05)
#Inspect results
head(result$data)
result$moran
# }
Run the code above in your browser using DataLab