Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for issue with missing.contact.age "sample" and age.limits > 0 (#170
) * The combination of `age.limits` that did not start with 0 and the `missing.contact.age` option set to "sample" caused an issue. Specifically, the age groups below the defined `age.limits` were not excluded, unlike with the `missing.contact.age` options "ignore" or "remove." This led to a contact matrix containing contacts with an age of NA. A corresponding `testthat` case has been added to validate this function's behavior. * Style code (GHA) * Changed expact_equal(x, y) to expect_identical(x, y) in the new testthat cases on the missing.contact.age. * Style code (GHA) * Use 2L instead of as.integer(2) * Resolved the issue with the `testthat` instance on `missing.contact.age`, which was introduced in the last update where `is.integer(3)` was changed to `2L` instead of `3L`. * Added a defensive check to ensure the "ignore" code for `missing.contact.age` is only executed if there is (non-NA) information available to sample from. Additionally, ensured that the final set does not include `NA` values for `contact.age` with this user option. --------- Co-authored-by: lwillem <[email protected]>
- Loading branch information