Make convert_*()
functions S3 generics
#255
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR closes #166 by converting the conversion functions (
convert_*()
) in {epiparameter} into S3 generic functions, and providing S3 methods forcharacter
and<epidist>
types. Thecharacter
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.