render plots in docx #18
Open
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.
close #14
This pull request expands the functionality of the
save_with_rmarkdownfunction to support saving ggplot and grid graphics objects (in addition to tables) to a docx file.Expanded object support and refactoring:
accepted_object_classes(replacingaccepted_table_classes) to define accepted S3 classes, now including"gg","ggplot", and"grob"alongside table classes. (R/accepted_object_classes.R[1]R/accepted_table_classes.R[2]NAMESPACE[3]man/accepted_object_classes.Rd[4]man/accepted_table_classes.Rd[5]save_with_rmarkdownto accept and correctly process ggplot2 and grid graphics objects, as well as lists containing any combination of supported objects. (R/save_with_rmarkdown.R[1] [2] [3]Dependency and documentation updates:
ggplot2to the packageSuggestsfield to support new functionality. (DESCRIPTIONDESCRIPTIONR24)Testing:
save_with_rmarkdownworks with ggplot2 plots, grid graphics, and lists containing mixed object types. (tests/testthat/test-save_with_rmarkdown.Rtests/testthat/test-save_with_rmarkdown.RR59-R87)Internal logic improvements:
"ggplot"/"gg"to"ggplot2","grob"to"grid"). (R/save_with_rmarkdown.RR/save_with_rmarkdown.RL72-R88)