Skip to content

Commit eb2f322

Browse files
committed
differences for PR #112
1 parent 2f8223e commit eb2f322

File tree

5 files changed

+257
-34
lines changed

5 files changed

+257
-34
lines changed

.DS_Store

-6 KB
Binary file not shown.

BF_measles.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,15 +802,34 @@ controlling the epidemic.
802802
# Load new infections data for each scenario
803803
data_vaccine <- epidemics::new_infections(
804804
output3,
805-
compartments_from_susceptible = "vaccinated",
805+
exclude_compartments = "vaccinated",
806806
by_group = TRUE
807807
)
808+
```
809+
810+
``` error
811+
Error in epidemics::new_infections(output3, exclude_compartments = "vaccinated", : unused argument (exclude_compartments = "vaccinated")
812+
```
808813

814+
``` r
809815
# Assign scenario names
810816
data_vaccine$scenario <- "Vaccination"
817+
```
818+
819+
``` error
820+
Error: object 'data_vaccine' not found
821+
```
811822

823+
``` r
812824
# Combine the data from both scenarios (baseline and vaccination)
813825
data_combined2 <- bind_rows(data_baseline, data_vaccine)
826+
```
827+
828+
``` error
829+
Error: object 'data_vaccine' not found
830+
```
831+
832+
``` r
814833
# Plot new infections over time by scenario and demographic groups
815834
ggplot(data_combined2) +
816835
# Plot new infections with lines for each demographic group and scenario
@@ -867,7 +886,9 @@ ggplot(data_combined2) +
867886
)
868887
```
869888

870-
<img src="fig/BF_measles-rendered-unnamed-chunk-11-1.png" style="display: block; margin: auto;" />
889+
``` error
890+
Error: object 'data_combined2' not found
891+
```
871892

872893

873894
## Combining interventions

md5sum.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
"episodes/contact-matrices.Rmd" "19856620d33f9b7f4e8ee312460494f1" "site/built/contact-matrices.md" "2025-08-06"
88
"episodes/simulating-transmission.Rmd" "a416834465425e20bbd0a32afc6c2d32" "site/built/simulating-transmission.md" "2025-08-06"
99
"episodes/model-choices.Rmd" "aa195e66455fb6a97b4930fd08c08001" "site/built/model-choices.md" "2025-08-06"
10-
"episodes/modelling-interventions.Rmd" "3ca4185369a49bdf75828cd5ac43d5af" "site/built/modelling-interventions.md" "2025-08-06"
10+
"episodes/modelling-interventions.Rmd" "4ddf2a3e860dc11ba7a29ad20228eb3a" "site/built/modelling-interventions.md" "2025-08-19"
1111
"episodes/compare-interventions.Rmd" "2ef6697bbad9bcfb843ab9d50469123b" "site/built/compare-interventions.md" "2025-08-06"
12-
"episodes/vaccine-comparisons.Rmd" "a8fc8f333fc466dac9f53c5a17c24760" "site/built/vaccine-comparisons.md" "2025-08-06"
12+
"episodes/vaccine-comparisons.Rmd" "bb9110b17b2b5cdc915df3f17eae15df" "site/built/vaccine-comparisons.md" "2025-08-19"
1313
"episodes/disease-burden.Rmd" "05199c08e0f4394b341dd67b00f7a130" "site/built/disease-burden.md" "2025-08-06"
1414
"instructors/instructor-notes.md" "ca3834a1b0f9e70c4702aa7a367a6bb5" "site/built/instructor-notes.md" "2025-08-06"
15-
"learners/BF_measles.Rmd" "96bb097b26f09276c095e12f5c9927dc" "site/built/BF_measles.md" "2025-08-06"
15+
"learners/BF_measles.Rmd" "5725a25d664730bbce3736a3243c2182" "site/built/BF_measles.md" "2025-08-19"
1616
"learners/reference.md" "9e836f1ec999f95f55135cdd2c78d2e6" "site/built/reference.md" "2025-08-06"
1717
"learners/setup.md" "ba4314eaa33c1a26c7005999ae684326" "site/built/setup.md" "2025-08-06"
1818
"profiles/learner-profiles.md" "31b503c4b5bd1f0960ada730eca4a25e" "site/built/learner-profiles.md" "2025-08-06"

modelling-interventions.md

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,8 @@ Pharmaceutical interventions (PIs) are measures such as vaccination and mass tre
332332

333333
The diagram below shows the SEIRV model implemented using `model_default()` where susceptible individuals are vaccinated and then move to the $V$ class.
334334

335-
<img src="fig/modelling-interventions-rendered-diagram_SEIRV-1.png" style="display: block; margin: auto;" />
335+
<!--html_preserve--><div class="grViz html-widget html-fill-item" id="htmlwidget-dc9df32b70b283a80419" style="width:504px;height:504px;"></div>
336+
<script type="application/json" data-for="htmlwidget-dc9df32b70b283a80419">{"x":{"diagram":"digraph {\n\n # graph statement\n ################\n graph [layout = dot,\n rankdir = LR,\n overlap = true,\n fontsize = 10]\n\n # nodes\n #######\n node [shape = square,\n fixedsize = true\n width = 1.3]\n\n S\n E\n I\n R\n V\n\n # edges\n #######\n S -> E [label = \" infection (&beta;)\"]\n S -> V [label = \" vaccination (&nu;)\"]\n E -> I [label = \" onset of \ninfectiousness (&alpha;)\"]\n I -> R [label = \" recovery (&gamma;)\"]\n\n}","config":{"engine":"dot","options":null}},"evals":[],"jsHooks":[]}</script><!--/html_preserve-->
336337

337338

338339

@@ -430,7 +431,7 @@ From the plot, we see that the peak number of total number of infectious individ
430431
::::::::::::::::::::::::::::::::::::::::::::::::
431432

432433
Lastly, if you want to plot new infections from an `epidemics::model_default()` that includes a `vaccination` intervention, you need to add one argument to `epidemics::new_infections()`:
433-
Set `compartments_from_susceptible = "vaccinated"` to tell the function that people moving from "susceptible" to "vaccinated" are not becoming infected. This ensures vaccinated individuals aren't counted as infections.
434+
Set `exclude_compartments = "vaccinated"` to tell the function that people moving from "susceptible" to "vaccinated" are not becoming infected. This ensures vaccinated individuals aren't counted as infections.
434435

435436
::::::::::::::::::::: spoiler
436437

@@ -440,26 +441,57 @@ Note that if we add `by_group = FALSE` in `epidemics::new_infections()`, we get
440441
``` r
441442
infections_baseline <- epidemics::new_infections(
442443
data = output_baseline,
443-
compartments_from_susceptible = "vaccinated", # if vaccination
444+
exclude_compartments = "vaccinated", # if vaccination
444445
by_group = FALSE
445446
)
447+
```
448+
449+
``` error
450+
Error in epidemics::new_infections(data = output_baseline, exclude_compartments = "vaccinated", : unused argument (exclude_compartments = "vaccinated")
451+
```
446452

453+
``` r
447454
infections_intervention <- epidemics::new_infections(
448455
data = output_vaccinate,
449-
compartments_from_susceptible = "vaccinated", # if vaccination
456+
exclude_compartments = "vaccinated", # if vaccination
450457
by_group = FALSE
451458
)
459+
```
452460

461+
``` error
462+
Error in epidemics::new_infections(data = output_vaccinate, exclude_compartments = "vaccinated", : unused argument (exclude_compartments = "vaccinated")
463+
```
464+
465+
``` r
453466
# Assign scenario names
454467
infections_baseline$scenario <- "Baseline"
468+
```
469+
470+
``` error
471+
Error: object 'infections_baseline' not found
472+
```
473+
474+
``` r
455475
infections_intervention$scenario <- "Vaccination"
476+
```
456477

478+
``` error
479+
Error: object 'infections_intervention' not found
480+
```
481+
482+
``` r
457483
# Combine the data from both scenarios
458484
infections_baseline_interv <- dplyr::bind_rows(
459485
infections_baseline,
460486
infections_intervention
461487
)
488+
```
489+
490+
``` error
491+
Error: object 'infections_baseline' not found
492+
```
462493

494+
``` r
463495
infections_baseline_interv %>%
464496
ggplot(aes(x = time, y = new_infections, colour = scenario)) +
465497
geom_line() +
@@ -472,7 +504,9 @@ infections_baseline_interv %>%
472504
theme_bw()
473505
```
474506

475-
<img src="fig/modelling-interventions-rendered-unnamed-chunk-6-1.png" style="display: block; margin: auto;" />
507+
``` error
508+
Error: object 'infections_baseline_interv' not found
509+
```
476510

477511
To get an age-stratified plot, keep the default `by_group = TRUE` and then add `linetype = demography_group` when declaring variables in `ggplot(aes(...))`.
478512

0 commit comments

Comments
 (0)