sMCDA Tool is a Shiny application for spatial Multi-Criteria Decision Analysis (sMCDA). It supports:
- Weighted Sum
- ELECTRE-TRI (Outranking)
- deterministic and uncertain inputs (SMAA-style uncertainty handling)
- export to images, CSV, XLSX, and ESRI shapefiles
The app is now organized in a golem-compatible structure while preserving legacy logic.
R/run_app.R: main entrypointR/app_ui.R: UI wrapperR/app_server.R: server wrapperR/legacy_loader.R: loader for legacy app definitionsinst/app/legacy_definitions.R: legacyuiandserverinst/app/global.R: legacy global setup and utility functions
- R 4.5.x (the lockfile was generated with R
4.5.1) - internet connection for first restore/install
- enough disk space for the local
renvlibrary
- Install R 4.5.x from CRAN.
- Install Rtools45 (needed if source compilation is required).
- Most CRAN binaries should avoid manual system setup for
sf/terra.
- Install R 4.5.x.
- Install Command Line Tools:
xcode-select --install- If source compilation is needed (especially for geospatial packages):
brew install gdal geos proj udunitssudo apt update
sudo apt install -y \
build-essential gfortran \
libcurl4-openssl-dev libssl-dev libxml2-dev \
libfontconfig1-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev \
libharfbuzz-dev libfribidi-dev \
libudunits2-dev libgdal-dev libgeos-dev libproj-devsudo dnf install -y \
gcc gcc-c++ gcc-gfortran make \
libcurl-devel openssl-devel libxml2-devel \
fontconfig-devel freetype-devel libpng-devel libtiff-devel libjpeg-turbo-devel \
harfbuzz-devel fribidi-devel \
udunits2-devel gdal-devel geos-devel proj-devel- Clone the repository and open R/RStudio in the project root.
- Activate and restore dependencies:
source("renv/activate.R")
renv::restore(prompt = FALSE)- Verify environment consistency:
renv::status()If everything is correct, renv::status() should report no issues.
source("app.R")
run_app()source("R/legacy_loader.R")
source("R/app_ui.R")
source("R/app_server.R")
source("R/run_app.R")
run_app()install.packages("remotes")
remotes::install_local(".")
sMCDATool::run_app()shiny::runApp("inst/app")renv.lockstores exact package versions.- The project uses an isolated local library (not your global user library).
- Every collaborator should restore from
renv.lockfor reproducibility.
Restore from lockfile:
renv::restore(prompt = FALSE)Check lockfile/library consistency:
renv::status()Update dependencies and record them:
renv::update()
renv::snapshot(prompt = FALSE)Rebuild a problematic package:
renv::rebuild("sf")Clean unused packages:
renv::clean()- Run
renv::restore()after eachgit pull. - Develop normally.
- If you intentionally change dependency versions, run
renv::snapshot(). - Commit
renv.lock(andrenv/files if they changed).
Typical symptom: errors reaching cloud.r-project.org.
- check proxy/firewall settings
- retry on a different network
- configure a company-approved CRAN mirror if required
Usually caused by missing system libraries. Install OS prerequisites above, then run:
renv::restore(prompt = FALSE)Usually non-blocking if the app starts correctly.
For full alignment, use the same R minor version as the team and re-run renv::restore().
Map export uses webshot. If needed:
webshot::install_phantomjs().gitignore: required to avoid committing temporary/local files..Rbuildignore: recommended for R package builds to exclude non-package artifacts.
This repository includes a workflow:
.github/workflows/deploy-shinyapps.yaml
It deploys inst/app to shinyapps.io on:
- successful completion of
R-CMD-checkonmain/master - manual trigger (
workflow_dispatch)
This means deploy is gated: if checks fail, deployment does not run.
Required GitHub repository secrets:
SHINYAPPS_NAME(your shinyapps.io account name, e.g.mspada)SHINYAPPS_TOKENSHINYAPPS_SECRET
You can create token/secret from shinyapps.io account settings (Tokens).
This project is licensed under GNU GPL v2. See LICENSE.