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

Name and sort population_age vector #81

Merged
merged 5 commits into from
Feb 22, 2024
Merged

Name and sort population_age vector #81

merged 5 commits into from
Feb 22, 2024

Conversation

joshwlambert
Copy link
Member

This PR addresses comments raised by the package review PR #73. It names the population_age vector with "lower" and "upper" and sorts the vector in case the user provides the age vector as c(upper_bound, lower_bound).

Throughout the code elements of population_age are now extracted as [["lower"]] and [["upper"]] instead of [1] and [2].

This development also found a bug in sim_contacts() when age structured populations are supplied to population_age. The <data.frame> supplied by the user was not being transformed (by .check_age_df()) before being passed to .sim_internal() (which was happening in sim_linelist() and sim_outbreak()). This has been fixed and a test added to check this use case.

@joshwlambert joshwlambert merged commit 7286210 into main Feb 22, 2024
7 checks passed
@joshwlambert joshwlambert deleted the named_age_range branch February 22, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant