## bug for plotting with interval = 1
library(outbreaks)
library(incidence2)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
dat <- ebola_sim_clean$linelist
glimpse(dat)
#> Rows: 5,829
#> Columns: 11
#> $ case_id <chr> "d1fafd", "53371b", "f5c3d8", "6c286a", "0f58…
#> $ generation <int> 0, 1, 1, 2, 2, 0, 3, 3, 2, 3, 4, 3, 4, 2, 4, …
#> $ date_of_infection <date> NA, 2014-04-09, 2014-04-18, NA, 2014-04-22, …
#> $ date_of_onset <date> 2014-04-07, 2014-04-15, 2014-04-21, 2014-04-…
#> $ date_of_hospitalisation <date> 2014-04-17, 2014-04-20, 2014-04-25, 2014-04-…
#> $ date_of_outcome <date> 2014-04-19, NA, 2014-04-30, 2014-05-07, 2014…
#> $ outcome <fct> NA, NA, Recover, Death, Recover, NA, Recover,…
#> $ gender <fct> f, m, f, f, f, f, f, f, m, m, f, f, f, f, f, …
#> $ hospital <fct> Military Hospital, Connaught Hospital, other,…
#> $ lon <dbl> -13.21799, -13.21491, -13.22804, -13.23112, -…
#> $ lat <dbl> 8.473514, 8.464927, 8.483356, 8.464776, 8.452…
i <- incidence(dat, date_index = date_of_onset)
plot(i)
#> Error: Must extract column with a single valid subscript.
#> ✖ Subscript `week_var` can't be `NA`.