Function to create and save a PNG file given a plotting function to run.

save_png_figure(plotting_fun, file_name, figure_dim = c(5, 5), res = 300, ...)

Arguments

plotting_fun

A function, with the creation of a figure as a side effect.

file_name

A character string, the file name for the PNG file - must end in '.png'.

figure_dim

A numeric vector of two values, the width and height of the figure in inches.

res

A integer value, the resolution for the PNG file.

...

Additional arguments to pass to plotting_fun.

Value

Output from plotting_fun, if any.