Closed joshwlambert closed 6 months ago
This pull request:
(Note that results may be inacurrate if you branched from an outdated version of the target branch.)
This pull request:
(Note that results may be inacurrate if you branched from an outdated version of the target branch.)
I haven't reviewed the PR, I trust you with the implementation. Just a reminder to update the NEWS.md
with this change before merging :wink:
This PR has been reviewed as part of PR #101 which builds on top of this feature branch. I will now merge both of these PRs.
I will update the NEWS.md
in a follow-up PR before releasing the package.
This PR addresses a feature request from #36 to add explicit onset-to-recovery time delays. This feature adds the
onset_to_recovery
argument to thesim_linelist()
andsim_outbreak()
functions, which by default isNA
to not provide explicit recovery dates as this is thought to be the most common scenario when collecting line list information. Theonset_to_recovery
argument works identically toonset_to_death
andonset_to_hosp
, whereby it can be an<epidist>
object, or an anonymous function to parameterise the delay distribution.There is a breaking change as part of this PR with respect to the output line list
<data.frame>
fromsim_linelist()
andsim_outbreak()
. The$date_death
column has been replace with two columns,$outcome
and$date_outcome
. Currently the$outcome
column is a character string with either"died"
or"recovered"
. The$date_outcome
column contains the date of the corresponding event (in the same row). This was decided from discussions in #36.The Visualising line list data vignette (
vis-linelist.Rmd
) is updated to aggregate the new line list structure, and now includes a code chunk that uses {tidyr}. As a result, {tidyr} is added as a suggested package dependency.The
.add_death()
function has been updated and renamed to.add_outcome()
to deal with deaths and recoveries..cross_check_sim_input()
is updated to return compound warnings or errors if necessary instead of returning multiple warnings or stopping on the first error.Tests have been updated in line with the updates to exported and internal functions, including updating the
tests/testthat/testdata/
.