Changelog
Source:NEWS.md
tracee 0.1.0
This version comes with several improvements, new functions and bugfixes. While previous versions provided functions to save to tables and figures with stamps, version 0.1.0 improves the consistency of those functions, adds a consistent framework to define file path and naming based on output name, model name and script name. This means one can freely define if outputs should be saved in folders and with file names based on a model name and or a script name. If saving a plot object, , this could look like
ggwrite(p,file="myplot.png",model="models/mymodel.lst",script="myscript.R",path.format="outputs/%script/%model_%name")this would generate a file in “outputs/myscript/mymodel_myplot.png” which will include a “stamp” in the bottom with script, model, and output name information.
You can also use the lwrite() (“list write”) function to achieve this for a set of outputs which can be a mix of figures, tables, and data.frames. Those would then be dispatched to relevant writers.
Suppose p is a plot, and ft is a flextable object.
lwrite(list(myplot=p,mytab=ft),
path.format="outputs/%script/%model_%name",
,model="models/mymodel.lst",script="myscript.R")would create the two files “outputs/myscript/myplot_mymodel.png” and “outputs/myscript/mytab_mymodel.png”
New Features
This list of improvements is far from exhaustive.
A
modelargument is generally added to writer functions to allow for model information in tags.Stamping mechanism has been re-written and greatly improved. Stamps format (what to write) is controlled by
stamp.format(very similar topath.formatfor file paths) and styling (font etc.) is controlled bystamp.gg.style(plots) andstamp.ft.style(flextables). The default isstamp.format="%file\n%script\n%model\n%time"with labels added by the defaultstamp.funs(“Output:”, “Script:”, “Model:”, “Time:”). Components that are not provided are skipped.stamp.gg.styleis a list of arguments passed toelement_text.Plot stamps are now left-justified by default and placed in the bottom right corner. Placement and justification are controlled independently by
stamp.gg.style$position("left","center","right"or a number between 0 and 1) andstamp.gg.style$hjust.Generation of stamps have been streamlined between
ggwrite()andftwrite(), and they are now using the same underlying mechanism for simplification.ftwrite()gains theshowargument. Similarly toggwrite(), this allows to control printing to file and screen independently.ggwrite()(and wrappers) gains support for the ragg device which is now default. This improves reproducibility across systems.traceit()can be used to modify saving options for individual outputs that are saved in lists and written at once withlwrite(). The options chosen withtraceit()will then overwrite defaults for the specific plots.arguments like
modelandscriptcan be pre-prossed before used in paths and stamps. Like when usingpath.format="%script-%name", one may want to truncate the script path or name before generating the file name. This can be done independently for generation of paths (paths.funs) and stamps (stamps.funs).
Bugfixes
-
ftwrite()would need thebgargument even though a default value was apparently provided. Now that default is actually being used.
Other changes
-
pathStruct()has been renamed topathFormat().pathStruct()is deprecated and callspathFormat()with a message. - The
structureargument ofpathFormat()andlwrite()has been renamed topath.format.structureis deprecated but still works (with a message). -
ggwritegives a message instead of a warning when empty spaces are being removed from file names.
tracee 0.0.4
CRAN release: 2024-01-08
Bugfixes
-
ggwrite()in some cases wouldn’t write a list of plots to multiple pngs. Fixed.
tracee 0.0.3
CRAN release: 2023-03-23
Changes
- Flextab function names aligned with functions for plots. writeFlextab is deprecated and now called ftwrite. stampFlextab is deprecated and now called ftstamp. These names match ggwrite and ggstamp, respectively.
New features
Missing script argument supported in ftwrite.
ggwrite support multiple formats (new argument aligning with writeFlextab) and canvases. In this case, the canvas name will be appended to file names.
ftwrite now throws an error in case unsupported output formats are requested.
ftwrite support the ‘save’ argument like ggwrite.
tracee 0.0.2
CRAN release: 2022-10-15
New functions
- writeFlextab is a wrapper that flextable objects to files including a caption (stamp) referencing script path and output filename. The stamp is generated by the same underlying function as used when generating stamps for plots in ggstamp or ggwrite. stampFlextab is equivalent to ggstamp for plots.