Skip to the content.

spclustr

Rendered reports: mape_r-01 · mape_r-01_reto

spclustr is a personal learning lab of standalone R scripts reproducing spatial statistics tutorials, package vignettes, and papers. It is not an R package — each .R/.Rmd file is a self-contained reproduction covering one method or one package, spanning point pattern analysis, areal/disease mapping, geostatistics, GAM-based smoothing, and scan statistics for cluster detection (e.g. via spatstat, spdep, rsatscan).

What’s inside

The scripts are grouped below by the spatial-statistics theme they demonstrate. Each entry lists the script(s) and the key package(s) exercised.

Point pattern analysis

Intensity/density estimation, case-control (bivariate) patterns, spatio-temporal point processes, relative risk mapping.

Areal data & disease mapping

Choropleths, cartograms, Moran’s I spatial autocorrelation, spatial GLM regression, Bayesian (BYM/INLA) disease mapping.

Find a recent implementation of Moran’s Index spatial autocorrelation, as well as High-High and Low-Low clusters (for spatial correlation and incidence rate), for spatiotemporal analysis with {epiCo}

Geostatistics

Trend surfaces, variograms, kriging.

GAM-based spatial smoothing

Generalized additive models for smoothing spatial risk/odds surfaces.

Scan statistics for cluster detection

Spatial and space-time cluster detection.

Supporting utilities

Installation

This repo is a flat collection of scripts, not an installable R package — there is no DESCRIPTION or renv.lock. To run a script:

# 1. clone the repo, then open spclustr.Rproj in RStudio
# 2. install the packages required by the script you want to run, e.g.:
install.packages(c("spatstat", "sf", "tmap", "spdep", "gstat", "mgcv"))

# some scripts need packages outside CRAN:
# - INLA (used by moraga-RJ-2018-036.R):
install.packages("INLA", repos = "https://inla.r-inla-download.org/R/stable")
# - rsatscan (used by satscan-0-vignette.R) also requires the standalone
#   SaTScan desktop application installed separately: https://www.satscan.org/

# 3. run the script

References

Author

Acknowledgements

Some material here was originally prepared for Club de Análisis Espacial, a spatial-analysis study group, as teaching/challenge material for Sesión #5 (“mapear”).

License

MIT