Saves a ggplot object. By default it saves the last plot to be modified or created.

sbf_save_plot(
  x = ggplot2::last_plot(),
  x_name = substitute(x),
  sub = sbf_get_sub(),
  main = sbf_get_main(),
  caption = "",
  report = TRUE,
  tag = "",
  units = "in",
  width = NA,
  height = width,
  dpi = 300,
  limitsize = TRUE,
  csv = 1000L
)

Arguments

x

The ggplot object to save.

x_name

A string of the name.

sub

A string specifying the path to the sub folder (by default the current sub folder).

main

A string specifying the path to the main folder (by default the current main folder)

caption

A string of the caption.

report

A flag specifying whether to include in a report.

tag

A string of the tag.

units

A string of the units. Can be "in" (default) or "mm" or "cm".

width

A number of the plot width in inches.

height

A number of the plot width in inches.

dpi

A number of the resolution in dots per inch.

limitsize

When TRUE (the default), ggsave() will not save images larger than 50x50 inches, to prevent the common error of specifying dimensions in pixels.

csv

A count specifying the maximum number of rows to save as a csv file.