Skip to content

Commit

Permalink
added argument defaults to sim_* functions, WIP #120
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlambert committed Jun 25, 2024
1 parent ef350f2 commit a70ea29
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions R/sim_contacts.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
#' infectious_period = infectious_period,
#' prob_infection = 0.5
#' )
sim_contacts <- function(contact_distribution,
infectious_period,
prob_infection,
sim_contacts <- function(contact_distribution = function(x) stats::dpois(x = x, lambda = 2),
infectious_period = function(x) stats::rlnorm(n = x, meanlog = 2, sdlog = 0.5),
prob_infection = 0.5,
outbreak_start_date = as.Date("2023-01-01"),
anonymise = FALSE,
outbreak_size = c(10, 1e4),
Expand Down
10 changes: 5 additions & 5 deletions R/sim_linelist.R
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@
#' hosp_risk = age_dep_hosp_risk
#' )
#' head(linelist)
sim_linelist <- function(contact_distribution,
infectious_period,
prob_infection,
onset_to_hosp,
onset_to_death,
sim_linelist <- function(contact_distribution = function(x) stats::dpois(x = x, lambda = 2),
infectious_period = function(x) stats::rlnorm(n = x, meanlog = 2, sdlog = 0.5),
prob_infection = 0.5,
onset_to_hosp = function(x) stats::rlnorm(n = x, meanlog = 1.5, sdlog = 0.5),
onset_to_death = function(x) stats::rlnorm(n = x, meanlog = 2.5, sdlog = 0.5),
onset_to_recovery = NULL,
hosp_risk = 0.2,
hosp_death_risk = 0.5,
Expand Down
10 changes: 5 additions & 5 deletions R/sim_outbreak.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@
#' onset_to_hosp = onset_to_hosp,
#' onset_to_death = onset_to_death
#' )
sim_outbreak <- function(contact_distribution,
infectious_period,
prob_infection,
onset_to_hosp,
onset_to_death,
sim_outbreak <- function(contact_distribution = function(x) stats::dpois(x = x, lambda = 2),
infectious_period = function(x) stats::rlnorm(n = x, meanlog = 2, sdlog = 0.5),
prob_infection = 0.5,
onset_to_hosp = function(x) stats::rlnorm(n = x, meanlog = 1.5, sdlog = 0.5),
onset_to_death = function(x) stats::rlnorm(n = x, meanlog = 2.5, sdlog = 0.5),
onset_to_recovery = NULL,
hosp_risk = 0.2,
hosp_death_risk = 0.5,
Expand Down

0 comments on commit a70ea29

Please sign in to comment.