Adding 2 possible quantile dot plot functions #357
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.
As I mentioned at #354 I have been working on adding quantile dot plots. It was more complicated than I was expecting, so I wanted to make sure about the direction of this.
Current Progress
So far, I have implemented two functions,
ppc_qdotplot
which under the hood utilisesgeom_dotplot
andppc_qdotplot_ggdist
which utilisesstat_dots
fromggdist
.qdotplot
This function utilises
geom_dotplot
, which gives a very simple way to build dot plots.geom_dotplot
function has two main deficiencies:geom_dotplot
doesn't have a proper auto-sizing for dots, the visual is getting clipped and not presenting the full picture.To minimise the first problem, I implemented a simple auto-sizing algorithm which performs well when the bin width is not specified or very reasonably specified; however, when it is even a little unsuitable, it is likely to run into issues. Here are some example uses of
ppc_qdotplot
:As you can see, for certain bin widths, dots are over-compressed or exceed the limit of the graphic.
qdotplot_ggdist
The second alternative relies on
stat_dots
fromggdist
. It is slightly more successful overall in handling edge cases and has a warning system; however, it also brings additional dependency to the package, making me unsure if we want to go that route. The advantages of this overqdotplot
are:In the previous three graphics where the dots do not fit into the visual, the following error is thrown at the console:
ppc_qdotplot_ggdist
can be used with quantiles as follows:Future
To move forward, I think we need to decide on which function we want to keep and whether we want to add
ggdist
dependency. After that, I can remove the unnecessary function and continue with the rest of the implementation.geom_dotplot
versionstat_dots