README.md

Mental Health Surge Modelling The Strategy Unit Logo

Lifecycle:
stable R build
status Codecov test
coverage License:
MIT

This package is a Shiny application to model the surge in mental health needs caused by the COVID-19 pandemic. It is hosted at strategyunit.shinyapps.io/MH_Surge_Modelling. Documentation for the code is available at the-strategy-unit.github.io/723_mh_covid_surge_modelling.

The model framework has been guided by literature reviews and expert opinions. Data on population groups is sourced from both routine and local data and variables for the model are based on a mixture of Trust returns and extracts from MHSDS and IAPT datasets within NCDR.

Usage

devtools::install_github("The-Strategy-Unit/723_mh_covid_surge_modelling")
mhSurgeModelling::run_app()

Project Structure

This package uses the {golem} framework. All of the code is organised in the R/ folder. The files are structured in the following way:

Data files required at runtime by the application are stored in the inst/app/data folder:

Developing

If you wish to run this locally, first make a fork in GitHub. You can then clone the repository directly in RStudio.

Once you have the repository cloned, you need to make sure that you have all of the package’s dependencies installed:

remotes::install_deps(dependencies = TRUE)

Once the dependencies are installed the quickest way to run the application is to run the script dev/run_dev.R.

source("dev/run_dev.R", echo = TRUE)

As this is a package you need to follow package development practices; reading the r-pkgs book is a great start. In particular, make sure any dependecies on other packages are stated in the DESCRIPTION file and any functions that you are importing are described using roxygen2.

The devtools package is very useful to use during development. You can load the package to test code quickly using devtools::load_all(), and documentation can be re-created using devtools::document(). It is worth running the latter anytime you change code, especially when adding new functions or imports.

It is also worth regularly running r-cmd-check to quickly identify issues.

The package documentation is built using pkgdown. This is done automatically on deployment, but you can view locally by running pkgdown::build_site().

Contributing

Contributions are welcome, but please note that this tool was developed for a specific project, so we may not be able to accept all changes. Please file an issue to discuss any bugs or changes before filing a pull request.

Deployment

This package has been configured to use CI/CD with GitHub Actions. There are currently 5 actions:



The-Strategy-Unit/723_mh_covid_surge_modelling documentation built on April 13, 2022, 8:52 a.m.