Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add defaults to all exported function arguments #149

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

joshwlambert
Copy link
Member

@joshwlambert joshwlambert commented Jun 25, 2024

This PR addresses #120 and #145 (#146 has also been resolved in this PR, see comment below) by adding defaults to the arguments in sim_linelist(), sim_contacts() and sim_outbreaks() that were previously missing.

This now enables these functions to be run without the user specifying any arguments, e.g. linelist <- sim_linelist().

The documentation for the arguments has also be improved as suggested in #145. In combination with the argument documentation, the README, vignettes and function examples have also been added to. These now cover using a simple function call without specifying any arguments (in the README and function examples), using predefined and anonymous functions (in the simulist.Rmd vignette).

Regression unit tests have been added for the new simpler function calls for sim_*() functions.

Documentation for several internal function is also updated (mainly because of inheriting documentation from sim_*() functions).

@joshwlambert joshwlambert added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 25, 2024
Copy link
Member

@chartgerink chartgerink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @joshwlambert 🙏

Given that I am wrapping up before my summer holidays, I did not dive in too deep. I did request this addition so I tested the end result - and it is of great help for demo purposes to be able to run sim_linelist() and sim_contact() and get results.

Thank you again for picking up this suggestion, I appreciate it!

R/sim_linelist.R Outdated Show resolved Hide resolved
R/sim_linelist.R Show resolved Hide resolved
@joshwlambert
Copy link
Member Author

This PR now also addresses #146 by not warning users if the *_risk arguments are left as their default values when onset_to_hosp or onset_to_death are set to NULL.

The onset_to_* and *_risk argument documentation has been updated to reflect this change.

@joshwlambert joshwlambert requested a review from sbfnk July 2, 2024 12:13
R/sim_linelist.R Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants