-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
93 lines (63 loc) · 3.94 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/"
)
```
```{r setup, include = FALSE}
pkg = 'flowdiagramr' #so we can easily switch names
library(pkg, character.only = TRUE)
```
# flowdiagramr <img src="man/figures/logo.png" align="right" alt="" width="120" />
<!-- badges: start -->
[![R-CMD-check](https://github.com/andreashandel/flowdiagramr/workflows/R-CMD-check/badge.svg)](https://github.com/andreashandel/flowdiagramr/actions)
[![test-coverage](https://github.com/andreashandel/flowdiagramr/workflows/test-coverage/badge.svg)](https://github.com/andreashandel/flowdiagramr/actions)
[![Codecov coverage](https://codecov.io/gh/andreashandel/flowdiagramr/branch/main/graph/badge.svg)](https://codecov.io/gh/andreashandel/flowdiagramr?branch=main)
<!-- badges: end -->
**This package is still under active development. If you see this message, assume that several parts of the package don't quite work yet.**
## Description
**`r pkg`** allows automated creation of flow diagrams for compartmental simulation models using ggplot. Other types of flow charts are also supported.
## Quick example
These few lines of code create a simple diagram of and SIR model using **`r pkg`**
```{r}
#install if needed - package is not yet on CRAN
# remotes::install_github('andreashandel/flowdiagramr')
library(flowdiagramr)
#specify model
mymodel = list( varlabels = c("S","I","R"),
flows = list(S_flows = c("-b*S*I"),
I_flows = c("b*S*I","-g*I"),
R_flows = c("g*I"))
)
#prepare diagram
diagram_list <- prepare_diagram(mymodel)
#make diagram
my_diagram <- make_diagram(diagram_list)
#plot diagram
plot(my_diagram)
```
## Getting Started
If you think something like this is of interest to you, hop on over to the [_Quick Start_ tutorial (vignette)](https://andreashandel.github.io/flowdiagramr/articles/A_quickstart.html).
## Further information
**`r pkg`** gives you many options to easily customize diagrams. You can also make diagrams that are not based on compartmental models. To explain (most) everything **`r pkg`** can do, we wrote several tutorials/vignettes. Here they are listed for convenience.
**Main tutorials/vignettes**
*You should go through them in this order*
1. [Quick start guide](https://andreashandel.github.io/flowdiagramr/articles/A_quickstart.html)
2. [Modifying diagrams I](https://andreashandel.github.io/flowdiagramr/articles/B_prepare_diagram_settings.html)
3. [Modifying diagrams II](https://andreashandel.github.io/flowdiagramr/articles/C_update_diagram_function.html)
4. [Modifying the ggplot2 object or code](https://andreashandel.github.io/flowdiagramr/articles/D_modify_ggplot_code.html)
**Additional tutorials/vignettes**
*Read them based on interest, in any order*
* [Making non-model based diagrams](https://andreashandel.github.io/flowdiagramr/articles/E_non_model_diagrams.html)
* [Additional diagram examples](https://andreashandel.github.io/flowdiagramr/articles/F_additional_examples.html)
* [Additional topics](https://andreashandel.github.io/flowdiagramr/articles/G_additional_topics.html)
* [Comparison to other R packages](https://andreashandel.github.io/flowdiagramr/articles/H_comparison_to_other_packages.html)
The package website (if you are not already on it) is [here.](https://andreashandel.github.io/flowdiagramr/) You can access all the tutorials from there, as well as some additional information.
## Citation and Contributors
This R package was developed by [Andrew Tredennick]( https://atredennick.github.io/) and [Andreas Handel](https://www.andreashandel.com/). A full list of contributors and a Bibtex entry for the citation [can be found here](https://andreashandel.github.io/flowdiagramr/authors.html).
This project was/is partially supported by NIH grants R01 GM124280 and GM 12480-03S1.