The goal of sacmetrics is to calculate spatial autocorrelation metrics for spatial data.
You can install the development version of sacmetrics from GitHub with:
# install.packages("pak")
pak::pak("Nowosad/sacmetrics")
library(sacmetrics)
library(gstat)
vgm_model1 = vgm(psill = 2, model = "Sph", range = 100, nugget = 0.5)
vgm_model2 = vgm(psill = 1.5, model = "Exp", range = 120, nugget = 0.7)
plot(variogramLine(vgm_model1, maxdist = 300), type = "l", col = "blue",
xlab = "Distance", ylab = "Semivariance")
lines(variogramLine(vgm_model2, maxdist = 300), col = "red")
vgm_auc(vgm_model1, maxdist = 300)
#> [1] 675.0004
vgm_auc(vgm_model2, maxdist = 300)
#> [1] 494.7753
vgm_compare(vgm_model1, vgm_model2, maxdist = 300)
#> [1] 0.733Contributions to this package are welcome – let us know if you have any suggestions or spotted a bug. The preferred method of contribution is through a GitHub pull request. Feel also free to contact us by creating an issue.
The initial development of this R package was made possible through the financial support of the European Union’s Horizon Europe research and innovation programme under the Marie Skłodowska-Curie grant agreement No. 101147446.
