This is a shiny app accompanied with the R package comomodels
to interactively explore the model behaviors of in response to different transmission parameters.
Currently we support five sub-models:
To contribute to this repository, please read DEVELOPMENT.md
Click here to easily explore comomodels-explore
online.
In addition to the online version, comomodels-explore
is also open accessible and can be run locally.
If you have a number of dependencies not installed yet, instead of manually installing each of them, you can save time and energy by installing all dependencies in a conda
environment:
Create a package-specific conda environment: ``` # clone the repository with git, go to the cloned directory: git clone git@github.com:Como-DTC-Collaboration/comomodels-explore.git cd comomodels-explore
conda env create -f envs/comomodels-explore.yml
conda activate comoexplore
* The core package `comomodels` need to be manually installed in R:
r
devtools::install_github("Como-DTC-Collaboration/como-models")
``
* Data
* Some models (e.g. SEIRDAge and SEIRD_RU) require the loading of extra data, such as social contact matrices between age groups and country-specific population data, etc. The default data in
comomodelsare in .rda format and also provided here in the
./data` folder, which are fully usable as an example. Referring to the same format, Users can also create and use customised data.
# 1. use runGitHub
shiny::runGitHub("comomodels-explore", "Como-DTC-Collaboration", ref = "main")
# 2. alternatively, run a tar or zip file
shiny::runUrl("https://github.com/Como-DTC-Collaboration/comomodels-explore/archive/main.tar.gz")
shiny::runUrl("https://github.com/Como-DTC-Collaboration/comomodels-explore/archive/main.zip")
git clone git@github.com:Como-DTC-Collaboration/comomodels-explore.git
cd comomodels-explore/
# start an R environment
R
In the R environment, make sure your working directory is comomodels-explore
and all dependencies are installed. Then run the app
setwd(".")
## if you are using an interactive R session (e.g. RStudio):
shiny::runApp(appDir = ".")
## otherwise, set `launch.browser=FALSE` and manually launch the browser in the next step:
shiny::runApp(appDir = ".", launch.browser=FALSE)
Either way, a local URL will appear on your R console, e.g.:
Listening on http://127.0.0.1:5554
The corresponding interface may automatically pop out. If not, you can manually copy-and-paste the above URL to any web server.
You can now play around with the parameters on the interface.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.