powered by
Returns the Getis Ord G*i in standardized form.
gstar_i(shp, adj, wts, spatial_mat, epsg = 3857)
vector of G*i scores
sf data frame. Optional if adj or spatial_mat provided.
zero indexed adjacency list. Optional if shp or spatial_mat provided.
Required. Numeric vector with weights to use for Moran's I.
matrix of spatial weights. Optional if shp or adj provided.
numeric EPSG code to planarize to. Default is 3857.
library(dplyr) data('checkerboard') checkerboard <- checkerboard %>% mutate(m = as.numeric((id + i) %% 2 == 0)) gstar_i(shp = checkerboard, wts = checkerboard$m)
Run the code above in your browser using DataLab