This PR addresses #230 by improving the documentation and flexibility to interact with the packages that create the S3 distribution objects {distributional} and {distcrete}, by adding a ... argument to create_epidist_prob_dist() (renamed from create_prob_dist()) and to epidist() and new_epidist() (the internal <epidist> constructor).
create_epidist_prob_dist(), previously create_prob_dist(), is now an exported function and has been renamed to use the same naming style as other <epidist> helper functions (e.g. create_epidist_summary_stats(), creat_epidist_metadata(), etc.). It is now exported to allow users to easily update the prob_dist element in an existing <epidist>, e.g.:
The function documentation of create_epidist_prob_dist() now contains more information and links to {distcrete} and {distributional}. Note currently extra arguments can only be passed to distcrete::distcrete() and not {distributional} functions, but the documentation of create_epidist_prob_dist() does make this distinction clear as it may be in the future that distributional functions can take extra arguments. I'd be happy to change the create_epidist_prob_dist() documentation to make it more similar to epidist() documentation on ... which is more directed at distcrete::distcrete().
epidist() and new_epidist() gain the ... argument in order for users to modify discretisation details when constructing an <epidist>.
A new unit test is added to check create_epidist_prob_dist() correctly passes argument via ..., and tests have been updated to use the up-to-date functions that have been renamed.
This PR addresses #230 by improving the documentation and flexibility to interact with the packages that create the S3 distribution objects {distributional} and {distcrete}, by adding a
...
argument tocreate_epidist_prob_dist()
(renamed fromcreate_prob_dist()
) and toepidist()
andnew_epidist()
(the internal<epidist>
constructor).create_epidist_prob_dist()
, previouslycreate_prob_dist()
, is now an exported function and has been renamed to use the same naming style as other<epidist>
helper functions (e.g.create_epidist_summary_stats()
,creat_epidist_metadata()
, etc.). It is now exported to allow users to easily update theprob_dist
element in an existing<epidist>
, e.g.:The function documentation of
create_epidist_prob_dist()
now contains more information and links to {distcrete} and {distributional}. Note currently extra arguments can only be passed todistcrete::distcrete()
and not {distributional} functions, but the documentation ofcreate_epidist_prob_dist()
does make this distinction clear as it may be in the future thatdistributional
functions can take extra arguments. I'd be happy to change thecreate_epidist_prob_dist()
documentation to make it more similar toepidist()
documentation on...
which is more directed atdistcrete::distcrete()
.epidist()
andnew_epidist()
gain the...
argument in order for users to modify discretisation details when constructing an<epidist>
.A new unit test is added to check
create_epidist_prob_dist()
correctly passes argument via...
, and tests have been updated to use the up-to-date functions that have been renamed.