epiverse-trace / simulist

An R package for simulating line lists
https://epiverse-trace.github.io/simulist/
Other
4 stars 0 forks source link

Quick start example throwing error #105

Closed chartgerink closed 2 months ago

chartgerink commented 2 months ago

Please place an "x" in all the boxes that apply


I was trying to run the quick start for simulist but got an error while doing so. I figure that's not the start we want so reporting to track whether we need to update this 😊

Code example:

# insert reprex here
library(simulist)
library(epiparameter)

# create COVID-19 contact distribution
contact_distribution <- epiparameter::epidist(
  disease = "COVID-19", 
  epi_dist = "contact distribution", 
  prob_distribution = "pois", 
  prob_distribution_params = c(mean = 2)
)

# create COVID-19 contact interval
contact_interval <- epiparameter::epidist(
  disease = "COVID-19",
  epi_dist = "contact interval",
  prob_distribution = "gamma",
  prob_distribution_params = c(shape = 1, scale = 1)
)

# get onset to hospital admission from {epiparameter} database
onset_to_hosp <- epiparameter::epidist_db(
  disease = "COVID-19",
  epi_dist = "onset to hospitalisation",
  single_epidist = TRUE
)

# get onset to death from {epiparameter} database
onset_to_death <- epiparameter::epidist_db(
  disease = "COVID-19",
  epi_dist = "onset to death",
  single_epidist = TRUE
)

set.seed(1)
linelist <- sim_linelist(
  contact_distribution = contact_distribution,
  contact_interval = contact_interval,
  prob_infect = 0.5,
  onset_to_hosp = onset_to_hosp,
  onset_to_death = onset_to_death
)
head(linelist)

I am getting the following error as I run the quick start example:

Error in sim_linelist(contact_distribution = contact_distribution, contact_interval = contact_interval,  : 
  unused argument (contact_interval = contact_interval)
joshwlambert commented 2 months ago

Thanks for raising. This has been updated in the package, but the pkgdown site is only rendered for new releases, so this is the v0.2.0 documentation, running v0.2.0.9000 (soon to be v0.3.0) code. Once the package is released it will be resolved, see the README in the package for the latest Quick start.

I'd be happy to hear ideas on having the pkgdown CI render the website more regularly between releases to prevent this sort of issue happening again.

TimTaylor commented 2 months ago

You can also look at https://epiverse-trace.github.io/simulist/dev/ for the dev version

joshwlambert commented 2 months ago

Thanks @TimTaylor. I'm not sure how many people know about this dev page.

However, this issue should be solved when we host on CRAN as it will install the version documented on the website, whereas now {pak} or {remotes} will get the latest version from main. So I'll close this issue, @chartgerink feel free to reopen if there is still something you'd like to discuss or change.

chartgerink commented 2 months ago

For what it's worth @joshwlambert, the instructions on the page use pak to install the developer version so it's not onboarding friendly at the moment. I am okay with whatever you decide 👍

joshwlambert commented 2 months ago

I agree. This could be something to discuss at the developer meeting as I imagine it could be an issue for all Epiverse packages that are not on CRAN and are not having short development-cycle releases.