Skip to content

Commit

Permalink
Adding incidence2 to list of loaded packages
Browse files Browse the repository at this point in the history
  • Loading branch information
CarmenTamayo committed Apr 23, 2024
1 parent 3d723bf commit 3247d0c
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions inst/rmarkdown/templates/transmissibility/skeleton/skeleton.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ library(rio)
library(linelist)
library(janitor)
library(kableExtra)
library(incidence2)
library(grateful)
library(epiparameter)
library(incidence2)
```

```{r}
Expand Down Expand Up @@ -315,7 +315,7 @@ dat <- dat_raw %>%

## Epidemic curves

This section creates epidemic curves ("_epicurves_"), with and without stratification by [name of grouping variable].
This section creates epidemic curves ("_epicurves_"), with or without stratification.

```{r}
# convert daily incidence into weekly incidence using incidence2
Expand All @@ -331,19 +331,10 @@ n_groups <- dplyr::n_distinct(get_groups(dat_i)[[1]])
small_counts <- max(get_count_value(dat_i)) < 20
```

```{r}
#Plot to visualise an epicurve with total cases of disease over time
dat_i %>%
plot(fill = group_var, angle = 45, colour_palette = muted) +
labs(
title = "Weekly incidence of disease cases", x = "", y = "Incidence")
```

```{r fig.height = 5 / 3 * n_groups}
#Plot to generate epicurves stratified by group_var
dat_i %>%
plot(alpha = 1, nrow = n_groups) +
labs(x = "", y = "Incidence")
labs(title = "Incidence of cases over time")
```

## Numbers of cases
Expand Down

0 comments on commit 3247d0c

Please sign in to comment.