Skip to contents

Package-wide helper used by the vignettes to persist a ggplot figure to a per-vignette res/res_<topic>/ folder, writing both a .png and an .eps copy. Saving is gated by bl_save so a vignette can keep all outputs off by default and flip individual figures on through its ls_save_res control list.

Usage

ffp_save_res_figure(
  plt,
  name,
  spt_res,
  bl_save = TRUE,
  fl_width = 250,
  fl_height = 150,
  it_dpi = 150
)

Arguments

plt

A ggplot object.

name

File stem (no extension) for the <name>.png / <name>.eps files.

spt_res

Destination folder; created recursively if missing.

bl_save

If FALSE, do nothing (control switch). Default TRUE.

fl_width, fl_height

Figure dimensions in millimetres.

it_dpi

Resolution in dots per inch.

Value

Invisibly NULL. Called for its side effect of writing files.

Author

Fan Wang, http://fanwangecon.github.io