Allow for easy insertion of ggplot plots in a table column via a formatter#155
Open
rich-iannone wants to merge 13 commits intomasterfrom
Open
Allow for easy insertion of ggplot plots in a table column via a formatter#155rich-iannone wants to merge 13 commits intomasterfrom
rich-iannone wants to merge 13 commits intomasterfrom
Conversation
jcheng5
suggested changes
Mar 11, 2019
Member
jcheng5
left a comment
There was a problem hiding this comment.
As discussed in person, I think all such features shouldn't be specific to ggplot but should work with all static R plots.
* master: (37 commits) Use webshot to generate images of HTML tables (#257) Rewritten vignette for adding summary rows (#273) Move roxygen documentation to Markdown (#253) Store empty-string value in `sep` vector (#274) Bugfixes and improvements to `summary_rows()` (#175) Modify _travis.yml (#263) Make several refactoring improvements to some `format_*()` functions (#244) Include option to hide all column labels (#237) Refactoring of formatter functions (#232) Improvement to the handling of a `pattern` in most `fmt*()` functions (#95) pkgdown cleanup (#226) Make argument names in `tab_options()` more consistent with terminology (#221) dplyr::data_frame deprecated (#195) Remove a unicode character from roxygen documentation (#220) Try again, this time with `travis encrypt --com` Trying again with github token (#223) Use jcheng5 GitHub PAT instead of rich-iannone (#222) Update README (#219) Fix for `fmt_date()` that allows `Date` columns to work (#203) Remove check on macOS ...
Closed
|
@rich-iannone any update on this? embedded plots came up again for me today, and I'm getting by with a rebased version of this branch... can I help at all? |
|
Hey! Any updates to this? I need to embed box plots in a table and would love to use this function. Thanks! |
|
It would be nice if this could be pushed. I think 90%+ of the use would be for ggplot, and it works well for that. |
This file contains hidden or 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
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.
The new
fmt_ggplot()function allows for easier inclusion of ggplot2 plots (within a list column of the input table data) into a gt table. The common pattern toward obtaining these plots is throughmutation of a list column containing all the
datarequired for plot:While the PR contains functionality to detect and automatically format columns containing ggplot2 plots, we can also opt to use the
fmt_ggplot()function to allow us to specifyrowsand set options for the plots'heightandaspect_ratio.Here are some examples of how this would work:
Here are images of
tab_1andtab_2:These are minimal examples showing the basic usage of inserting plots, so, the resulting tables look less than ideal. With some extra care given to setting common axis ranges and using
ggplot2::theme()to increase font sizes, line widths, etc., inserted plots would become more aesthetically pleasing.Fixes #152