Skip to content

Commit c16a65a

Browse files
committed
simplify activity three
1 parent c2405ef commit c16a65a

File tree

2 files changed

+6
-24
lines changed

2 files changed

+6
-24
lines changed

instructors/data/04-practical-activity-3.R

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Practical 4
44
# Activity 3
55

6+
# step: fill in your room number
67
room_number <- #<COMPLETE> replace with 1/2/3/4
78

89
# Combine interventions --------------------------------------------------
@@ -18,6 +19,7 @@ simulate_twointerventions <- epidemics::model_default(
1819
increment = 1.0
1920
)
2021

22+
epidemics::epidemic_peak(simulate_twointerventions)
2123

2224
# Visualize effect --------------------------------------------------------
2325
# Plot new infections
@@ -36,20 +38,9 @@ infections_twointerventions <- epidemics::new_infections(
3638
infections_baseline$scenario <- "Baseline"
3739
infections_twointerventions$scenario <- "ADD intervention 1 + ADD intervention 2" #<COMPLETE>
3840

39-
# Combine the data from both scenarios
40-
infections_baseline_twointerventions <- bind_rows(
41-
infections_baseline,
42-
infections_twointerventions
43-
)
44-
45-
infections_baseline_twointerventions %>%
46-
ggplot(aes(x = time, y = new_infections, colour = scenario)) +
47-
geom_line() +
48-
scale_y_continuous(labels = scales::comma)
49-
50-
5141
# Compare interventions --------------------------------------------------
5242

43+
# Combine the data from both scenarios
5344
compare_interventions <- bind_rows(
5445
infections_baseline,
5546
infections_intervention,

instructors/fig/04-practical-instructor-3.R

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Practical 4
44
# Activity 3
55

6+
# step: fill in your room number
67
room_number <- 2
78

89
# Combine interventions --------------------------------------------------
@@ -21,6 +22,7 @@ simulate_twointerventions <- epidemics::model_default(
2122
increment = 1.0
2223
)
2324

25+
epidemics::epidemic_peak(simulate_twointerventions)
2426

2527
# Visualize effect --------------------------------------------------------
2628
# Plot new infections
@@ -39,20 +41,9 @@ infections_twointerventions <- epidemics::new_infections(
3941
infections_baseline$scenario <- "Baseline"
4042
infections_twointerventions$scenario <- "Mask mandate + School closure"
4143

42-
# Combine the data from both scenarios
43-
infections_baseline_twointerventions <- dplyr::bind_rows(
44-
infections_baseline,
45-
infections_twointerventions
46-
)
47-
48-
infections_baseline_twointerventions %>%
49-
ggplot(aes(x = time, y = new_infections, colour = scenario)) +
50-
geom_line() +
51-
scale_y_continuous(labels = scales::comma)
52-
53-
5444
# Compare interventions --------------------------------------------------
5545

46+
# Combine the data from all scenarios
5647
compare_interventions <- dplyr::bind_rows(
5748
infections_baseline,
5849
infections_intervention, # varies depending on last one runned

0 commit comments

Comments
 (0)