Skip to contents

Saves a ggplot object to reports/figures/. Intended for use in targets pipelines as a file-producing target.

Usage

save_report_figure(
  plot,
  filename,
  out_dir = "reports/figures",
  width = 12,
  height = 6.75,
  dpi = 300
)

Arguments

plot

A ggplot object.

filename

Character. Output filename, e.g. "fig_fraud_by_month.png".

out_dir

Character. Output directory. Default "reports/figures".

width, height, dpi

Numeric. Passed to ggplot2::ggsave().

Value

Character. Normalized path to the saved file.