The function to apply Getis-Ord's local G statistics

local_g(
  w,
  df,
  permutations = 999,
  permutation_method = "complete",
  significance_cutoff = 0.05,
  cpu_threads = 6,
  seed = 123456789
)

Arguments

w

An instance of Weight object

df

A data frame with selected variable only. E.g. guerry["Crm_prs"]

permutations

(optional) The number of permutations for the LISA computation

permutation_method

(optional) The permutation method used for the LISA computation. Options are 'complete', 'lookup'. Default is 'complete'.

significance_cutoff

(optional) A cutoff value for significance p-values to filter not-significant clusters

cpu_threads

(optional) The number of cpu threads used for parallel LISA computation

seed

(optional) The seed for random number generator

Value

An instance of LISA-class

Examples

library(sf)
guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
guerry <- st_read(guerry_path)
#> Reading layer `Guerry' from data source 
#>   `/Users/runner/work/_temp/Library/rgeoda/extdata/Guerry.shp' 
#>   using driver `ESRI Shapefile'
#> Simple feature collection with 85 features and 29 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 47680 ymin: 1703258 xmax: 1031401 ymax: 2677441
#> Projected CRS: NTF (Paris) / Lambert zone II
queen_w <- queen_weights(guerry)
lisa <- local_g(queen_w, guerry["Crm_prs"])
lms <- lisa_values(lisa)
lms
#>  [1] 0.013819020 0.016115180 0.015686557 0.008553106 0.008955895 0.009334367
#>  [7] 0.013308440 0.008087712 0.013630374 0.006826279 0.007225672 0.007888609
#> [13] 0.014730484 0.007001527 0.010762953 0.013095840 0.015949284 0.011504575
#> [19] 0.014237186 0.015052499 0.013040676 0.010928335 0.014408469 0.008585361
#> [25] 0.012514332 0.012786474 0.015575579 0.006456438 0.007994853 0.010233479
#> [31] 0.012099990 0.007425918 0.015958393 0.013082465 0.015774323 0.011473900
#> [37] 0.014776298 0.012273577 0.014570953 0.011606663 0.009521038 0.014304123
#> [43] 0.012113381 0.009947183 0.010225083 0.007704696 0.013277240 0.014465491
#> [49] 0.015265007 0.013283953 0.017400436 0.010150263 0.014656976 0.014929657
#> [55] 0.011570904 0.014462851 0.016551293 0.012750574 0.014691353 0.018024844
#> [61] 0.013968480 0.009633574 0.010687124 0.006455805 0.009648260 0.009217817
#> [67] 0.015426694 0.013749051 0.015881541 0.014849044 0.010304059 0.015207027
#> [73] 0.011328897 0.011698016 0.013013919 0.014743898 0.008330537 0.008660000
#> [79] 0.007904004 0.007473691 0.012846891 0.013959041 0.014504177 0.011860750
#> [85] 0.013923847