library(timeplyr)
library(outbreaks)
library(dplyr)
# \dontshow{
.n_dt_threads <- data.table::getDTthreads()
.n_collapse_threads <- collapse::get_collapse()$nthreads
data.table::setDTthreads(threads = 1L)
collapse::set_collapse(nthreads = 1L)
# }
ebola_linelist <- ebola_sim_clean$linelist
# Incubation period distribution
# 95% of individuals experienced an incubation period of <= 26 days
inc_distr_days <- ebola_linelist %>%
get_time_delay(date_of_infection,
date_of_onset,
time = "days")
head(inc_distr_days$data)
inc_distr_days$unit
inc_distr_days$num
inc_distr_days$summary
head(inc_distr_days$delay) # ECDF and freq by delay
inc_distr_days$plot
# Can change bandwidth selector
inc_distr_days <- ebola_linelist %>%
get_time_delay(date_of_infection,
date_of_onset,
time = "day",
bw = "nrd")
inc_distr_days$plot
# Can choose any time units
inc_distr_weeks <- ebola_linelist %>%
get_time_delay(date_of_infection,
date_of_onset,
time = "weeks",
bw = "nrd")
inc_distr_weeks$plot
# \dontshow{
data.table::setDTthreads(threads = .n_dt_threads)
collapse::set_collapse(nthreads = .n_collapse_threads)
# }
Run the code above in your browser using DataLab