Adding "Identity Boxplot" to gt_plt_dist() #136
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.
Rationale
I use R (or Python) for ETL and write simple summary statistics while processing the data. I recently wanted to visualize a five-num summary I wrote out for each dataset as a boxplot within a {gt} table, but found that {gtExtras} didn't allow this natively, since it's always assumed that the full set of data is present in the list col passed. In my case, it is not always possible to include the full dataset--nor advisable, due to size--but I'd still like to construct rudimentary boxplots in my table.
It seems like an easy addition, since {ggplot2} already allows this behavior natively (and {sparkline} does as well via
spk_chr(., type="box", raw=TRUE)
).Changes
gt_plt_dist()
called "boxplot_identity" that allows a user to pass variables to define boxplot via ggplot'sstat="identity"
option rather than raw dataExample: