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

Make convert_*() functions S3 generics #255

Merged
merged 12 commits into from
Mar 25, 2024
Merged

Make convert_*() functions S3 generics #255

merged 12 commits into from
Mar 25, 2024

Conversation

joshwlambert
Copy link
Member

This PR closes #166 by converting the conversion functions (convert_*()) in {epiparameter} into S3 generic functions, and providing S3 methods for character and <epidist> types. The character method is similar to the previous implementation of the conversion functions.

The extract_convert.Rmd vignette now includes information on using <epidist> objects for the conversion functions. It is only included for gamma distributions but text is added that the same applies to all other distributions supported by {epiparameter}. This was to reduce the duplication and prevent the vignette from becoming too long.

The internal conversion functions now follow the naming convention of having a dot prefix (e.g .convert_params_lnorm()), which makes it easier to find exported conversion functions with autocomplete.

Some functions that call convert_*() functions have been updated to not use the old argument naming. The _pkgdown.yml is updated so that the <epidist> conversion methods are not duplicated. The WORDLIST is updated. Tests have been updated and new tests added for conversion with <epidist>. Regression tests now use snapshot testing to reduce the manual input of value checking.

@joshwlambert joshwlambert added enhancement New feature or request S3-method labels Mar 8, 2024
@joshwlambert joshwlambert merged commit b57fe20 into main Mar 25, 2024
9 checks passed
@joshwlambert joshwlambert deleted the convert_s3 branch March 25, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request S3-method
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make conversion functions S3 generics
1 participant