Skip to content

Commit 8cd8cba

Browse files
committed
replace argument to exclude vaccination in new_infections()
sync up with epiverse-trace/epidemics#256
1 parent cf43f83 commit 8cd8cba

3 files changed

Lines changed: 23 additions & 23 deletions

File tree

episodes/modelling-interventions.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ From the plot, we see that the peak number of total number of infectious individ
440440
::::::::::::::::::::::::::::::::::::::::::::::::
441441

442442
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()`:
443-
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.
443+
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.
444444

445445
::::::::::::::::::::: spoiler
446446

@@ -449,13 +449,13 @@ Note that if we add `by_group = FALSE` in `epidemics::new_infections()`, we get
449449
```{r}
450450
infections_baseline <- epidemics::new_infections(
451451
data = output_baseline,
452-
compartments_from_susceptible = "vaccinated", # if vaccination
452+
exclude_compartments = "vaccinated", # if vaccination
453453
by_group = FALSE
454454
)
455455
456456
infections_intervention <- epidemics::new_infections(
457457
data = output_vaccinate,
458-
compartments_from_susceptible = "vaccinated", # if vaccination
458+
exclude_compartments = "vaccinated", # if vaccination
459459
by_group = FALSE
460460
)
461461

episodes/vaccine-comparisons.Rmd

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -304,14 +304,14 @@ To understand the **indirect** effect of vaccinations, we want to know the effec
304304
The inputs required are :
305305

306306
+ `data` : the model output,
307-
+ `compartments_from_susceptible` : this is an optional input, but in our case needed. We don't want the number of people vaccinated to be counted as new infections, so we need to specify the name of the model compartment where individuals transition out from `susceptible` (in this example `vaccinated`),
307+
+ `exclude_compartments` : this is an optional input, but in our case needed. We don't want the number of people vaccinated to be counted as new infections, so we need to specify the name of the model compartment where individuals transition out from `susceptible` (in this example `vaccinated`),
308308
+ `by_group` : should the results be calculated for each demographic group separately.
309309

310310

311311
```{r}
312312
vaccinate_01_infections <- epidemics::new_infections(
313313
output_vaccinate_01,
314-
compartments_from_susceptible = "vaccinated",
314+
exclude_compartments = "vaccinated",
315315
by_group = FALSE
316316
)
317317
```
@@ -325,17 +325,17 @@ vaccinate_01_infections <- epidemics::new_infections(
325325
# calculate new infections
326326
baseline_infections <- epidemics::new_infections(
327327
output_baseline,
328-
compartments_from_susceptible = "vaccinated",
328+
exclude_compartments = "vaccinated",
329329
by_group = FALSE
330330
)
331331
vaccinate_01_infections <- epidemics::new_infections(
332332
output_vaccinate_01,
333-
compartments_from_susceptible = "vaccinated",
333+
exclude_compartments = "vaccinated",
334334
by_group = FALSE
335335
)
336336
vaccinate_02_infections <- epidemics::new_infections(
337337
output_vaccinate_02,
338-
compartments_from_susceptible = "vaccinated",
338+
exclude_compartments = "vaccinated",
339339
by_group = FALSE
340340
)
341341
@@ -385,17 +385,17 @@ infections %>%
385385
# calculate new infections
386386
baseline_infections <- epidemics::new_infections(
387387
output_baseline,
388-
compartments_from_susceptible = "vaccinated",
388+
exclude_compartments = "vaccinated",
389389
by_group = FALSE
390390
)
391391
vaccinate_01_infections <- epidemics::new_infections(
392392
output_vaccinate_01,
393-
compartments_from_susceptible = "vaccinated",
393+
exclude_compartments = "vaccinated",
394394
by_group = FALSE
395395
)
396396
vaccinate_02_infections <- epidemics::new_infections(
397397
output_vaccinate_02,
398-
compartments_from_susceptible = "vaccinated",
398+
exclude_compartments = "vaccinated",
399399
by_group = FALSE
400400
)
401401
@@ -578,17 +578,17 @@ output_vaccinate_group_3 <- epidemics::model_default(
578578
579579
vaccinate_group_1_infections <- epidemics::new_infections(
580580
output_vaccinate_group_1,
581-
compartments_from_susceptible = "vaccinated",
581+
exclude_compartments = "vaccinated",
582582
by_group = FALSE
583583
)
584584
vaccinate_group_2_infections <- epidemics::new_infections(
585585
output_vaccinate_group_2,
586-
compartments_from_susceptible = "vaccinated",
586+
exclude_compartments = "vaccinated",
587587
by_group = FALSE
588588
)
589589
vaccinate_group_3_infections <- epidemics::new_infections(
590590
output_vaccinate_group_3,
591-
compartments_from_susceptible = "vaccinated",
591+
exclude_compartments = "vaccinated",
592592
by_group = FALSE
593593
)
594594
@@ -702,17 +702,17 @@ output_vaccinate_group_3 <- epidemics::model_default(
702702
703703
vaccinate_group_1_infections <- epidemics::new_infections(
704704
output_vaccinate_group_1,
705-
compartments_from_susceptible = "vaccinated",
705+
exclude_compartments = "vaccinated",
706706
by_group = FALSE
707707
)
708708
vaccinate_group_2_infections <- epidemics::new_infections(
709709
output_vaccinate_group_2,
710-
compartments_from_susceptible = "vaccinated",
710+
exclude_compartments = "vaccinated",
711711
by_group = FALSE
712712
)
713713
vaccinate_group_3_infections <- epidemics::new_infections(
714714
output_vaccinate_group_3,
715-
compartments_from_susceptible = "vaccinated",
715+
exclude_compartments = "vaccinated",
716716
by_group = FALSE
717717
)
718718
@@ -789,7 +789,7 @@ To convert infections to deaths, we will need new infections by age group, so we
789789
```{r}
790790
vaccinate_group_1_age <- epidemics::new_infections(
791791
output_vaccinate_group_1,
792-
compartments_from_susceptible = "vaccinated",
792+
exclude_compartments = "vaccinated",
793793
by_group = TRUE
794794
)
795795
@@ -808,7 +808,7 @@ vaccinate_group_1_deaths <-
808808
809809
vaccinate_01_age <- epidemics::new_infections(
810810
output_vaccinate_01,
811-
compartments_from_susceptible = "vaccinated",
811+
exclude_compartments = "vaccinated",
812812
by_group = TRUE
813813
)
814814
@@ -823,7 +823,7 @@ vaccinate_01_deaths <-
823823
824824
vaccinate_group_2_age <- epidemics::new_infections(
825825
output_vaccinate_group_2,
826-
compartments_from_susceptible = "vaccinated",
826+
exclude_compartments = "vaccinated",
827827
by_group = TRUE
828828
)
829829
@@ -838,7 +838,7 @@ vaccinate_group_2_deaths <-
838838
839839
vaccinate_group_3_age <- epidemics::new_infections(
840840
output_vaccinate_group_3,
841-
compartments_from_susceptible = "vaccinated",
841+
exclude_compartments = "vaccinated",
842842
by_group = TRUE
843843
)
844844
@@ -854,7 +854,7 @@ vaccinate_group_3_deaths <-
854854
855855
baseline_age <- epidemics::new_infections(
856856
output_baseline,
857-
compartments_from_susceptible = "vaccinated",
857+
exclude_compartments = "vaccinated",
858858
by_group = TRUE
859859
)
860860

learners/BF_measles.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ controlling the epidemic.
769769
# Load new infections data for each scenario
770770
data_vaccine <- epidemics::new_infections(
771771
output3,
772-
compartments_from_susceptible = "vaccinated",
772+
exclude_compartments = "vaccinated",
773773
by_group = TRUE
774774
)
775775

0 commit comments

Comments
 (0)