- R ≥ 4.3
- RStudio or Quarto CLI
- Quarto ≥ 1.4 Install required R packages once:
install.packages(c("sf", "ggplot2", "dplyr", "ineq", "tiff", "tidyverse", "patchwork"))Data files are not tracked in this repo. Place them at the paths expected by R/00_config.R:
Download data folder from: Download link
data/
├── delft/
│ ├── raster/ # delft_worldpop_proj.tif, ndvi_delft_proj.tif, …
│ └── vector/ # delft_boundary_proj.gpkg, delft_osm_green_proj.gpkg, …
└── Yuexiu/
├── raster/ # Yuexiu_viirs_proj.tif, …
└── vector/ # yuexiu_boundary.gpkg, guangzhou_osm_green_proj.gpkg, …
All paths are centralised in
R/00_config.R— edit that file if your data lives elsewhere.
git clone https://github.com/Applied-Spatial-Analytics/create-your-report-groupe.gitOpen asa2025-report.Rproj in RStudio.
source("R/00_config.R") # paths & constants
source("R/01_load_data.R") # load & validate layers
source("R/02_accessibility.R") # SQ1 — green space access
source("R/03_typology_biodiversity.R")# SQ2 — typology & NDVI
source("R/04_spatial_justice.R") # SQ3 — Gini, equity
source("R/05_connectivity.R") # SQ4 — fragmentation & graph
source("R/06_mcda_nbs.R") # SQ5 — MCDA & corridorsFigures are saved automatically to report_files/.
In RStudio: open report.qmd and click Render, or from the terminal:
quarto render report.qmdOutput: report.html
APPLIED_SPATIAL_ANALYTICS/
├── data/
│ ├── delft/
│ │ ├── raster/ # delft_worldpop_proj.tif, ndvi_delft_proj.tif, etc.
│ │ └── vector/ # delft_boundary_proj.gpkg, delft_wijken_proj.gpkg, etc.
│ └── Yuexiu/
│ ├── raster/ # Yuexiu_viirs_proj.tif, Yuexiu_worldpop_proj.tif, etc.
│ └── vector/ # Yuexiu_boundary_proj.gpkg, Yuexiu_subdistricts_proj.gpkg, etc.
│
├── R/
│ ├── 00_config.R # ALL paths, CRS constants, thresholds — loaded by every script
│ ├── 01_load_data.R # Load + validate all layers, save checked objects to /outputs/
│ ├── 02_accessibility.R # SQ1 — green space per capita, buffers, nearest distance
│ ├── 03_typology_biodiversity.R # SQ2 — OSM typology, NDVI zonal stats, GBIF density
│ ├── 04_spatial_justice.R # SQ3 — Gini, bivariate choropleth, income/VIIRS correlation
│ ├── 05_connectivity.R # SQ4 — fragmentation metrics, graph connectivity
│ └── 06_mcda_nbs.R # SQ5 — MCDA scoring, corridor prioritisation
│
├── report_files/
│ └── [figures auto-saved here by ggsave()]
│
├── report.qmd # Narrative + renders figures from report_files/
└── README.md
- All file paths live in
R/00_config.R— no hardcoded paths elsewhere. - Uses only open, globally available datasets (OSM, WorldPop, GBIF, VIIRS, NDVI).
- The workflow is fully reproducible in any city/district by updating
00_config.R.