save_fig: helper for saving figures with GNU Make

View source: R/save_fig.R

save_figR Documentation

helper for saving figures with GNU Make

Description

Export a ggplot2 object as a pdf and a png

Usage

save_fig(plot, pdf_path = NULL, ht = NULL, wdth = NULL, ...)

Arguments

plot

a ggplot2 object

pdf_path

path to which plot should be saved; if NULL, will call commandArgs(trailingOnly = TRUE)[[1]] to accept command line argument

ht

height in inches, defaults to 9*0.4=3.6

wdth

width in inches, defaults to 16*0.4=6.4

...

other arguments passed to ggsave

Details

Also saves in ./presentations/presentation-figs for convenient use with xaringan HTML slide shows

Value

Silently writes files to disk and prints message


evanmascitti/ecmfuns documentation built on April 5, 2025, 1:52 a.m.