HSLdevcom / mal-effect-calculations

Impact assessment scripts for the Helsinki region MAL planning process
https://www.hsl.fi/hsl/mal
European Union Public License 1.2
1 stars 0 forks source link

mal-effect-calculations

This repository contains scripts for the impact assessment of the MAL Plan. Learn more about the MAL Plan here on our website.

Usage

Please note that you need to have access to various HSL Teams groups to get all input data you need.

  1. Clone this repository.
  2. In RStudio, select File > Open Project... > mal-effect-calculations.Rproj.
  3. Run renv::restore(). Now, you are using packages listed in renv.lock.
  4. Create \data, \figures, and \results folders.
  5. Collect input data:
    • Forecast data and model results from helmet-model-system
    • Spatial data for some of the assessments and visualisations (please review Helmet-ja-mittariajot\LUEMINUT.txt in MAL Teams)
  6. Set correct paths in config.yml file.
  7. To assess normal model runs, run scripts/figures/run.R.
  8. To assess agent model runs, run scripts/accessibility/run.R.

Data management

Paths to directories and files inside this repository are referenced relatively via here package. Paths to external input data are defined in config.yml. These include for example helmet-model-system data and result files.

Spatial input data in stored in data folder.

Results from scripts and analysis-friendly tidy data are saved to results folder. Plots, graphs, and maps are saved to figures folder.

Assessment scenarios are controlled in scenarios.tsv. Agent model scenarios are defined in config.yml and they can be changed in scripts/accessibility/run.R.

Version control

We using R-package renv that locks versions of packages. When doing analysis first time you should load packages with command: renv::restore(repos = "https://cloud.r-project.org", clean = TRUE). If packages are already loaded, use command renv::restore().

R version is set in renv.lock and is currently 4.3.0. This is not changed by renv, so you might want to check R/RStudio Global Options.

Further instructions about using renv during development and collaboration can be found on their website.

Authors