Skip to content

Commit 81d21c6

Browse files
committed
fix "confirmed cases" to disease reports (confirm)
1 parent e61911f commit 81d21c6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

episodes/quantify-transmissibility.Rmd

+8-6
Original file line numberDiff line numberDiff line change
@@ -116,26 +116,28 @@ dplyr::as_tibble(incidence2::covidregionaldataUK)
116116
To use the data, we must format the data to have two columns:
117117

118118
+ `date`: the date (as a date object see `?is.Date()`),
119-
+ `confirm`: number of confirmed cases on that date.
119+
+ `confirm`: number of disease reports (confirm) on that date.
120120

121121
Let's use `{tidyr}` and `{incidence2}` for this:
122122

123123
```{r, warning = FALSE, message = FALSE}
124124
cases <- incidence2::covidregionaldataUK %>%
125-
# use {tidyr} to preprocess missing values
125+
# Preprocess missing values
126126
tidyr::replace_na(base::list(cases_new = 0)) %>%
127-
# use {incidence2} to compute the daily incidence
127+
# Compute the daily incidence
128128
incidence2::incidence(
129129
date_index = "date",
130130
counts = "cases_new",
131131
count_values_to = "confirm",
132132
date_names_to = "date",
133133
complete_dates = TRUE
134134
) %>%
135-
# drop one column to adapt {EpiNow2} input
135+
# Drop column for {EpiNow2} input format
136136
dplyr::select(-count_variable) %>%
137-
# keep the first 90 dates and visualize epicurve
137+
# Keep the first 90 dates
138138
dplyr::slice_head(n = 90)
139+
140+
cases
139141
```
140142

141143
With `incidence2::incidence()` we aggregate cases in different time *intervals* (i.e., days, weeks or months) or per *group* categories. Also we can have complete dates for all the range of dates per group category using `complete_dates = TRUE`
@@ -506,7 +508,7 @@ The outbreak data of the start of the COVID-19 pandemic from the United Kingdom
506508

507509
+ `date`: the date,
508510
+ `region`: the region,
509-
+ `confirm`: number of confirmed cases for a region on a given date.
511+
+ `confirm`: number of disease reports (confirm) for a region on a given date.
510512

511513
Generate regional Rt estimates from the `incidence2::covidregionaldataUK` data frame by:
512514

0 commit comments

Comments
 (0)