epiverse-trace / simulist

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

Allow `onset_to_hosp` and `onset_to_death` to be `NA` #98

Closed joshwlambert closed 7 months ago

joshwlambert commented 7 months ago

This PR closes #94 by expanding the options for a user to pass to onset_to_hosp or onset_to_death arguments in sim_linelist() and sim_outbreak() to now include NA. If a user passes NA to either argument the resulting $date_admission or $date_death column in the line list will be populated with NAs.

This change requires some new functions being added to the package:

The .add_hospitalisation() and .add_death() functions were updated to accommodate the possibility that onset_to_hosp or onset_to_death could be NA (technically NA producing functions). .check_sim_input() is also updated.

Tests and documentation are added for new functions, and tests for new sim_linelist() functionality are also added.

Miscellaneous changes in this PR: