Skip to content

Commit ff30bad

Browse files
committed
add steps in skeleton files for transmission
1 parent 88e0871 commit ff30bad

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

instructors/data/02-practical-activity-1.R

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

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

89
# Load packages -----------------------------------------------------------
@@ -12,6 +13,8 @@ library(tidyverse)
1213

1314

1415
# Read reported cases -----------------------------------------------------
16+
# step: Paste the URL links as a string to read input data.
17+
1518
# for covid
1619
dat <- read_rds(
1720
"paste/link/url/here/covid"#<COMPLETE>
@@ -25,50 +28,61 @@ dat <- read_rds(
2528
dplyr::select(date, confirm = cases)
2629

2730

31+
# Verify format of incidence data ----------------------------------------
32+
# step: Check the column names in incidence data
33+
# match EpiNow2 requirement of column names: date and confirm
34+
35+
dat
36+
2837
# Define a generation time from {epiparameter} to {EpiNow2} ---------------
2938

30-
# access a serial interval
39+
# step: access a serial interval
3140
dat_serialint <- epiparameter::epiparameter_db(
3241
#<COMPLETE>
3342
)
3443

35-
# extract parameters from {epiparameter} object
44+
# step: extract parameters from {epiparameter} object
3645
dat_serialint_params <- epiparameter::#<COMPLETE>
3746

38-
# adapt {epiparameter} to {EpiNow2} distribution interface
47+
# step: adapt {epiparameter} to {EpiNow2} distribution interface
3948
dat_generationtime <- EpiNow2::#<COMPLETE>
4049

4150

4251
# Define the delays from infection to case report for {EpiNow2} -----------
4352

44-
# define delay from symptom onset to case report
53+
# step: define delay from symptom onset to case report
54+
# You need to interpret the description given in the Inputs table
55+
4556
dat_reportdelay <- EpiNow2::#<COMPLETE>
4657

47-
# define a delay from infection to symptom onset
58+
# step: define a delay from infection to symptom onset
4859
dat_incubationtime <- epiparameter::epiparameter_db(
4960
#<COMPLETE>
5061
)
5162

52-
# incubation period: extract distribution parameters
63+
# step: incubation period: extract distribution parameters
5364
dat_incubationtime_params <- epiparameter::#<COMPLETE>
5465

55-
# incubation period: discretize and extract maximum value (p = 99%)
66+
# step: incubation period: discretize and extract maximum value (p = 99%)
5667
dat_incubationtime_max <- dat_incubationtime %>% #<COMPLETE>
5768

58-
# incubation period: adapt to {EpiNow2} distribution interface
69+
# step: incubation period: adapt to {EpiNow2} distribution interface
5970
dat_incubationtime_epinow <- EpiNow2::#<COMPLETE>
6071

61-
# print required input
72+
# step: print required input
6273
dat_generationtime
6374
dat_reportdelay
6475
dat_incubationtime_epinow
6576

6677

6778
# Set the number of parallel cores for {EpiNow2} --------------------------
79+
# step: run this configuration step
80+
6881
withr::local_options(list(mc.cores = parallel::detectCores() - 1))
6982

7083

7184
# Estimate transmission using EpiNow2::epinow() ---------------------------
85+
# step: run epinow() using incidence cases, and required delays
7286
# with EpiNow2::*_opts() functions for generation time, delays, and stan.
7387
estimates <- EpiNow2::epinow(
7488
data = dat,
@@ -78,8 +92,11 @@ estimates <- EpiNow2::epinow(
7892

7993

8094
# Print plot and summary table outputs ------------------------------------
95+
# step: paste the figure and table outputs in the shared document
96+
8197
summary(estimates)
8298
plot(estimates)
8399

100+
# step: reply to questions in document
84101

85102
# nolint end

0 commit comments

Comments
 (0)