save_fig: Save a figure as a pdf

Description Usage Arguments Value

View source: R/helper_functions.R

Description

Save a figure as a pdf

Usage

1
save_fig(path, name, plot_call, plot_logical)

Arguments

path

string; path to the directory where the figure should be saved. If the directory does not already exist, it will be created. If there is already a figure in the directory with the same name, it will be overwritten.

name

string; name that should be given to the figure. Do not include ".pdf".

plot_call

plot; either the code to generate a plot (ex: plot(1:10)) or an active binding to code that generates a plot.

plot_logical

logical; TRUE if a plot has already been created and displayed in the default graphics device, otherwise FALSE.

Value

A saved pdf of the figure created by plot_call in the directory named by path.


smmueller/plotdesignr documentation built on Jan. 5, 2022, 10:55 a.m.