-
Notifications
You must be signed in to change notification settings - Fork 11
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
Improve <epidist>
plotting method
#315
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…update doc using plot.epidist
This was referenced May 24, 2024
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 improves the S3 plotting method for the
<epidist>
class (plot.epidist()
). The plotting function now plots a single distribution instead of a grid of two distributions. It plots the PDF/PMF by default, and can plot the cumulative distribution whencumulative = TRUE
.The updates mean there is a more noticable difference between plotting continuous versus discrete (or discretised) distributions. Before both would be plotted as dotted lines, now, the continuous distributions are plotted as curves, and the discrete (and discretised) distributions are plotted as bar graphs.
The
<vb_epidist>
plotting method (plot.vb_epidist()
) has been removed from the package in this PR as it was causing extra complication for theplot.epidist()
function and did not have any usage in the package (or from any users that we are aware of). This has the benefit that thevb
andtitle
arguments inplot.epidist()
have been removed, simplifying the function signature.The
day_range
argument has also been removed fromplot.epidist()
in favour of using the more idiomaticxlim
argument from theplot.default()
method (accessed via...
inplot.epidist()
). This will hopefully be familiar users that have used base R plotting.In the process issues #229 and #309 have been resolved.
A new function,
is_continuous()
has been added to the package to easily check whether an<epidist>
object contains a continuous distribution. This is called inplot.epidist()
to determine if the PDF or PMF should be plotted.The function documentation and vignettes have been updated where necessary and unit tests and snapshots have been updated.
This PR supersedes PR #235 which implemented improvements to the
<epidist>
plotting using {ggplot2}, {ggdist} and {gridExtra}. I will close PR #235 in favour of this PR, but will leave theplot_method
branch open for a few more months in case we decide to work on it or incorporate some features in the future.