Changelog
Source:NEWS.md
mrggsave 1.0.0
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 mrggsaveauthordefault (#59, #64).Cairo-based pdf output can be generated by passing
dev = "CairoPDF", which invokes theCairo::CairoPDF()device; the output file is given a.pdfextension. Any formal argument ofCairo::CairoPDF()can be passed through, but “back-end” arguments cannot. Global options are exposed to let users restore timestamps or override the mrggsaveauthordefault (#64).
Deprecated functionality
Drawing-related functionality has been removed: the
mrggdraw()anddraw_newpage()functions are gone, as is thedrawargument tomrggsave(). 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
.saveargument has been dropped frommrgglabel(); it was always passed asFALSEand could not be set by the user (#67).
mrggsave 0.4.7
Bugs Fixed
- Fixed bug when using a
tagto name plots when a full path toscriptwas provided (#53).
mrggsave 0.4.4
mrggsave()gains an argument calledpath.typewhich 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.typecan be set through themrggsave.path.typeoption (#38, #39).Unit tests were numbered and user stories added to build validation documents (#35, #37).
mrggsave 0.4.3
- Refactored how the
glue()environment was captured so that string interpolation is more robust when attempted in unique environments (for example inside function calls) (#26)
mrggsave 0.4.2
- Calling the
cairo_pdfdevice now allows multiple plots to be written to the same file (#21)
mrggsave 0.4.1
- Revert behavior where named list automatically uses the names for output file names #18
- Fix typo in
mrggsave:::output_file_sep()title
mrggsave 0.4.0
Breaking changes
- The default separator when auto-constructing file names is changed from underscore to hyphen; this is a breaking change that will result in different output filenames if users were using
tag#2 - Use the unexported (but documented) function
mrggsave:::output_file_sep()to globally change the output file separator character #12 - The
prefixargument tomrggsave_common()now defaults toNULL; theSource graphic:annotation defaults to only showing the base file name of the plot
Other changes and refactoring
- If a named list of plots is passed (checked via
rlang::is_named),use_nameswill be set toTRUEand names used for output filename #8 - Passing a list of plots generated by
named_plotswill setuse_namestoTRUEand the names will be use for output file names #8 - When a named list of plots is passed, the names are adjusted to remove spaces, periods and underscores when creating the output file stem; these characters are replaced with hyphens #8
-
mrggsave_common()now has alabellerargument; pass a function to create the annotation for the plot; passNULLto save a plot with no annotation #8 -
named_plots()gains an argument calledadd_context; whenTRUE, the context (usually the script name) will be pre-pended to the output file name; this argument isFALSEby default #8 - Add option called
mrggsave.file.tolowerwhich, if set toTRUEwill pass the file stem throughbase::tolower(), making it all lower case, regardless of how the stem was generated #8 - Add ability to save to multiple devices on one function call; pass a character vector of devices or a comma-separated string as
dev
mrggsave 0.2.0.9001
- Add support for the following devices: pdf, png, tiff, jpeg, eps, ps, bmp, svg (#13)
- Add ability to save last plot when it was created with ggplot2 (see the
mrggsave_lastfunction); this gets the last plot via ggplot2::last_plot (#12) - Add ability to save a named list of plots; when the list is named and the
use_namesargument is invoked, plots will get written out to their own file names (#14) - Add method for handing
ggsurvplotobjects (#11) - Pass the file name through
glue::glueonce it is formed from eitherstemortag(e.g.stem = "dv_pred_{runnumber}") (#15) - Add
named_plotsfunction to generate plot names (and eventually file names) from the code used to generate the plot (#14) - Add non-exported
contextfunction to set the output file name when usingtagargument;contextis set and is in effect viaoptionuntil the context is changed or reset; usecontext_clear - Removed support for objects created with patchwork
mrggsave 0.1.0.9002
- Added
ncolas a formal argument; whenncol> 1, we set arrange toTRUE - Added
mrggpagefunction as a wrapper aroundgridExtra::arrangeGrob - Added
mrggsave_list, which takes in a list of objects that are ready to label and to save without arrangement - Changed
mrggdrawso that all it does is draw a plot or plots, possibly after arranging -
mrggdrawnow returns processed plots invisibly so that they may be passed intomrggsave - Added internal generic
mrggsave_prep_objectand methods so that plots of different types can be passed directly tomrggsave_common - Added
mrggsave.gListfor savinggListobjects - When
tagorstemare given as a vector, the vector is collapsed using_as a separator first prior to forming any output file names - When a file name is formed from
tag, a_separator is automatically placed betweenscriptand the (possibly collapsed)tagvalue - Added support for
gtableobjects - Added a default
mrggsavemethod that assumes the object is a grob - Added argument to
mrggpageto allow a list of plots to be arranged across multiple pages; added methods for handlingarrangelistobjects coming out ofgridExtra::marrangeGrob