Save Plots to Files

save_plots(
  plots,
  path,
  prefix = "station",
  suffix = "plot",
  device = c("png", "pdf", "jpeg", "tiff"),
  dpi = 300,
  width = NULL,
  height = NULL,
  verbose = 1,
  cores = 1
)

Arguments

plots

Result of plot_adg() or plot_adfi().

path

Folder to write to (created if needed).

prefix, suffix

File name parts: <prefix>_<location>_<suffix>.<device>.

device

"png", "pdf", "jpeg" or "tiff".

dpi

Resolution for bitmap devices. Default 300.

width, height

Size in cm. By default computed from the number of panels.

verbose

0 (silent), 1 (summary, default).

cores

Number of CPU cores: stations are saved in parallel when more than 1. Default 1. Saving is mostly ggplot2 drawing time (about 1 s per station of 15 pigs), so with many stations this is the main speed-up.

Value

Invisibly, a data.table with location, file and saved.