Function to save ggplot figures.
write_ggplot.Rd
This is a wrapup function of write_plot
to print ggplot
object.
Usage
write_ggplot(
plot = last_plot(),
number = cctu_env$number,
width = 29.7 * 0.6,
height = 21 * 0.6,
dpi = 300,
units = "cm",
clean_up = TRUE,
directory = file.path(getOption("cctu_output", default = "Output"), "Figures"),
format = c("png", "postscript", "jpeg"),
graphics_args = NULL,
verbose = options()$verbose,
footnote = NULL
)
Arguments
- plot
the plot object to save. defaults to
last_plot
- number
the number used to as a suffix in the output filename, and to link to TableofTables. Default is to use the value in the cctu_env package environment that is set within
attach_pop
.- width
the width to save as
- height
the height to save as
- dpi
the resolution setting
- units
either "cm" (the default) or "inches"
- clean_up
logical to invoke the
clean_up
function at the end. Defaults to TRUE- directory
where to save the figures within path or current working directory. The Output directory can be over-riden with options("cctu_output").
- format
either "jpg", "postscript", or "png" to determine the file type to use
- graphics_args
a list of named arguments to supply to graphics function (png, postscript, jpeg)
- verbose
logical to print information on changes to the global environment or external files. Defaults to options()$verbose.
- footnote
character vector, can be used to add footnotes.
Value
writes a copy of a plot to file fig_number.. edits the TableofTables object with the calling programe No return object.