Skip to content

moj-analytical-services/DefCalc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DefCalc

Data and Analysis tool, designed to provide a central source for commonly used indices. Enables users to view, download and upload indices; and inflate, deflate and discount financial values.

Getting Started

This README file will provide developers with an overview of the project works.

Prerequisites

Developers MUST have access to:

  • MOJ-Analytical-Services organisation on Github, and the following repositories:

    • DefCalc; provides the code necessary to run the app
  • MOJ Analytical Platform:

    • RStudio
    • Webapp(s):
      • Defcalc
    • Webapp data source(s):
      • alpha-app-defcalc

Knowledge of R & Rshiny is strongly recommended.

Installing

To link the project to RStudio, it is recommended to clone the repositories using their respective SSH keys.

Key Files

Within the DefCalc repository, the following are key files:

  • ui.R; contains the code for producing the user interface of the app
  • server.R; contains the bulk of the code for the functions of the app
  • renv.lock; details all packages/dependencies required for the app to load

Botor

  • Users/developers will need to install the botor package in order to run the code. This is so that the app can access its own web bucket.
  • Guidance on installing can be found here: https://github.com/daroczig/botor

Updating

The underlying data for this app will require updating with each new OBR inflation forecasts, typically occuring in line with major policy announcements (e.g., Spring Budget)

  • Update the inflation data in the S3 webapp bucket alpha-app-defcalc
    • Update DA_inflation_tool_indexation_table_Month_YYYY.xlsx, renaming so it matches the current month
    • In the server.R file, update the botor::s3_read functions under HISTORIC INDEX DATA TABLES section to match the s3 bucket filepath
  • Update the weblinks in the server.R file for OBR DATA section to match OBR's latest forecasts
  • Update version number on HOMEPAGE

Future Updates

  • Switch excel tool to xlsm version (already in www/ folder) - this will require different package to "officer" and changes to the code. Will also need to update the guidance
  • Upload all presentations and supporting documents (including excel tool) into the s3 bucket and change code in the server.R file to read them in from s3

Deployment

When ready to deploy new releases, newly published releases should adhere to the following versioning formats: https://semver.org/