Skip to content

Conversation

@BFalquet
Copy link
Contributor

@BFalquet BFalquet commented Jan 23, 2026

close #14

This pull request expands the functionality of the save_with_rmarkdown function to support saving ggplot and grid graphics objects (in addition to tables) to a docx file.

Expanded object support and refactoring:

  • Introduced a new function accepted_object_classes (replacing accepted_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]
  • Updated save_with_rmarkdown to 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:

  • Added ggplot2 to the package Suggests field to support new functionality. (DESCRIPTION DESCRIPTIONR24)

Testing:

Internal logic improvements:

  • Enhanced logic for attaching required packages in the R Markdown header, mapping object classes to their respective packages (e.g., "ggplot"/"gg" to "ggplot2", "grob" to "grid"). (R/save_with_rmarkdown.R R/save_with_rmarkdown.RL72-R88)

@BFalquet BFalquet requested a review from Melkiades January 23, 2026 10:31
Copy link
Contributor

@Melkiades Melkiades left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job Benoit! I have only a minor suggestion about the help function ;)

@BFalquet BFalquet requested a review from Melkiades January 26, 2026 11:14
Signed-off-by: Davide Garolini <[email protected]>
Copy link
Contributor

@Melkiades Melkiades left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm! Thanks Benoit :)

@Melkiades
Copy link
Contributor

Ah @BFalquet need to redocument!

@BFalquet BFalquet merged commit 7dec617 into main Jan 27, 2026
9 checks passed
@BFalquet BFalquet deleted the 14-add-support-for-plots-ggplot-grob-bas branch January 27, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for plots (ggplot, grob, base R plots)

2 participants