output_to_png: Redirect Output of Plot Function to PNG file

View source: R/png.R

output_to_pngR Documentation

Redirect Output of Plot Function to PNG file

Description

Redirect the output of a plot function to a PNG file

Usage

output_to_png(
  FUN,
  args,
  filename,
  size = unlist(kwb.utils::DIN.A4()),
  units = "cm",
  res = 300,
  ...,
  dbg = TRUE
)

Arguments

FUN

plot function to be called

args

list of arguments given to the plot function FUN

filename

full path to the PNG file to be written. The extension ".png" will be automatically appended if it is omitted

size

vector containing the width (first element) and height (second element) of the plot, as passed to png. By default the dimensions of a DIN A4 page are used.

units

units as passed to png

res

resolution as passed to png

...

further arguments passed to png

dbg

if TRUE a message "Plotting to <filename>..." is shown


KWB-R/kwb.plot documentation built on Oct. 2, 2023, 10:16 p.m.