Function that generates a figure and saves it as a TIFF file using common settings.

save_tiff(
  file_name,
  fun_plot,
  dmn = c(5, 5),
  units = "in",
  res = 300,
  compression = "none",
  restoreConsole = TRUE,
  pointsize = 12,
  bg = "white",
  family = "",
  type = c("windows", "cairo"),
  symbolfamily = "default",
  return_file_name = FALSE,
  ...
)

Arguments

file_name

A character string, the desired path to the PNG file.

fun_plot

A function that generates a figure as output.

dmn

A numeric vector of two values, the width and height of the figure to save (default is in inches).

units

A character string, the units for figure dimensions (see grDevices::tiff).

res

An integer value, the figure resolution (see grDevices::tiff).

compression

A character string, the type of compression to use; see grDevices::tiff).

restoreConsole

A logical value, see grDevices::tiff).

pointsize

An integer value, the point size of text (see grDevices::tiff).

bg

a character string, the background color (see grDevices::tiff).

family

A character string specifying the font family (see grDevices::tiff).

type

A character string governing how plotting is done (see grDevices::tiff).

symbolfamily

A character stringth for cairographics options (see grDevices::tiff).

return_file_name

A logical value, if TRUE returns the file name as a character string.

...

Additional arguments for the fun_plot function.

Value

A JEPG file, and optionally the file name.