Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use a mermaid flowchart #366

Merged
merged 7 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Depends:
License: MIT + file LICENSE
RoxygenNote: 7.3.2
Suggests:
DiagrammeR,
gt,
knitr,
pkgdown,
Expand Down
Binary file removed man/figures/p4s_workflow_structure.png
Binary file not shown.
15 changes: 13 additions & 2 deletions vignettes/cookbook_running_the_analysis.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,19 @@ The PACTA for Supervisors analysis consists of four main steps:

The following diagram illustrates the structure of the workflow:

```{r workflow_structure, echo=FALSE, fig.cap='Fig. 1: Structure of the Workflow', fig.align='center', out.width='200px'}
knitr::include_graphics("../man/figures/p4s_workflow_structure.png")
```{r workflow_structure, echo=FALSE, fig.cap='Fig. 1: Structure of the Workflow', fig.align='center'}
DiagrammeR::mermaid('
graph TB;
id1("prepare_abcd()") --> id2("match_loanbooks()");
id2("match_loanbooks()") --> id3("prioritise_and_diagnose()");
id3("prioritise_and_diagnose()") --> id4("analyse()");
classDef nodeStyle fill: #45cfcc, stroke: #000, stroke-width: 2px;
class id1,id2,id3,id4 nodeStyle;
click id1 "../reference/prepare_abcd.html";
click id2 "../reference/match_loanbooks.html";
click id3 "../reference/prioritise_and_diagnose.html";
click id4 "../reference/analyse.html";
')
```

As the diagram shows, there is a logical sequence to how to run the functions. For any of the functions to work, the previous functions must have been run already and their outputs must be accessible as inputs to the next functions. If you want to keep different versions of the calculations, i.e. you want to avoid overwriting past outputs, you will have to (1) ensure that each run is done with a new value for the corresponding output directory set in the `config.yml` and (2) that the relevant function refers to the appropriate directories of upstream outputs. For example, if you want to run the analysis twice and keep both results, all `dir_*` entries of the `config.yml` should remain identical for both runs, except for the `dir_analysis` entry, which should be different for each run.
Expand Down
Loading