GithubHelp home page GithubHelp logo

han-tun / 723_mh_covid_surge_modelling Goto Github PK

View Code? Open in Web Editor NEW

This project forked from the-strategy-unit/723_mh_covid_surge_modelling

0.0 1.0 0.0 2.17 MB

Modelling of the surge caused by covid to Merseycare

Home Page: https://strategyunit.shinyapps.io/MH_Surge_Modelling/

License: Other

R 95.32% CSS 4.68%

723_mh_covid_surge_modelling's Introduction

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:

  • app_*.R files are the main application files

  • run_app.R is generated by the {golem} framework and run’s the entire application

  • module_*.R files are the shiny modules for the application: each “page” has it’s own module. These files contain both the ui and server functions for that module

  • plot_*.R files contain the code to produce the data for plots and the corresponding plot function. All plots for the application are generated using the {plotly} package

  • utils_*.R files contain the functions and utilities that are required by the application

  • ZZZ.R contains extra code, such as what variables to load into the global environment at start up

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

  • params_help.json contains the help text used on the params page

  • params_*.xlsx files are the default parameters files included with the application

  • report.Rmd is a RMarkdown report used to generate a .pdf download from the application

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:

  • lintr runs static code analysis to check for syntactical errors and code styling issues. This runs on all commits.
  • r-cmd-check runs R CMD CHECK. This runs on all commits.
  • covr uploads test coverage to codecov.io
  • shiny deploy runs only on successful PR’s to master and deploys the application.
  • pkgdown runs only on successful PR’s to master and deploys the documentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.