NEWS.md
mrggsave now requires R >= 4.1 (#58).
When using R 4.5.0 or greater, plots saved via the pdf() device are now written without timestamps or author information by default. Global options are included to enable the timestamp or to override the mrggsave author default (#59, #64).
Cairo-based pdf output can be generated by passing dev = "CairoPDF", which invokes the Cairo::CairoPDF() device; the output file is given a .pdf extension. Any formal argument of Cairo::CairoPDF() can be passed through, but “back-end” arguments cannot. Global options are exposed to let users restore timestamps or override the mrggsave author default (#64).
Drawing-related functionality has been removed: the mrggdraw() and draw_newpage() functions are gone, as is the draw argument to mrggsave(). This functionality carried extra complexity, but is not directly related to the core purpose of mrggsave (#67, #68).
The mrggpage() function has been removed; use patchwork to arrange plots instead (#66).
The .save argument has been dropped from mrgglabel(); it was always passed as FALSE and could not be set by the user (#67).
tag to name plots when a full path to script was provided (#53).mrggsave() gains an argument called path.type which controls how the path to the figure file is rendered in the figure annotation; the default is "proj", which will render the path relative to an RStudio project file, if it can be found; alternatives are "none" and "raw"; path.type can be set through the mrggsave.path.type option (#38, #39).
Unit tests were numbered and user stories added to build validation documents (#35, #37).
glue() environment was captured so that string interpolation is more robust when attempted in unique environments (for example inside function calls) (#26)cairo_pdf device now allows multiple plots to be written to the same file (#21)mrggsave:::output_file_sep() titletag #2mrggsave:::output_file_sep() to globally change the output file separator character #12prefix argument to mrggsave_common() now defaults to NULL; the Source graphic: annotation defaults to only showing the base file name of the plotrlang::is_named), use_names will be set to TRUE and names used for output filename #8named_plots will set use_names to TRUE and the names will be use for output file names #8mrggsave_common() now has a labeller argument; pass a function to create the annotation for the plot; pass NULL to save a plot with no annotation #8named_plots() gains an argument called add_context; when TRUE, the context (usually the script name) will be pre-pended to the output file name; this argument is FALSE by default #8mrggsave.file.tolower which, if set to TRUE will pass the file stem through base::tolower(), making it all lower case, regardless of how the stem was generated #8dev
mrggsave_last function); this gets the last plot via ggplot2::last_plot (#12)use_names argument is invoked, plots will get written out to their own file names (#14)ggsurvplot objects (#11)glue::glue once it is formed from either stem or tag (e.g. stem = "dv_pred_{runnumber}") (#15)named_plots function to generate plot names (and eventually file names) from the code used to generate the plot (#14)context function to set the output file name when using tag argument; context is set and is in effect via option until the context is changed or reset; use context_clear
ncol as a formal argument; when ncol > 1, we set arrange to TRUE
mrggpage function as a wrapper around gridExtra::arrangeGrob
mrggsave_list, which takes in a list of objects that are ready to label and to save without arrangementmrggdraw so that all it does is draw a plot or plots, possibly after arrangingmrggdraw now returns processed plots invisibly so that they may be passed into mrggsave
mrggsave_prep_object and methods so that plots of different types can be passed directly to mrggsave_common
mrggsave.gList for saving gList objectstag or stem are given as a vector, the vector is collapsed using _ as a separator first prior to forming any output file namestag, a _ separator is automatically placed between script and the (possibly collapsed) tag valuegtable objectsmrggsave method that assumes the object is a grobmrggpage to allow a list of plots to be arranged across multiple pages; added methods for handling arrangelist objects coming out of gridExtra::marrangeGrob