crsave: Wrapper function to save a ggplot with particular defaults

View source: R/crsave.R

crsaveR Documentation

Wrapper function to save a ggplot with particular defaults

Description

Wrapper function to save a ggplot with particular defaults

Usage

crsave(
  plot_object,
  path = NULL,
  type = NULL,
  device = NULL,
  scaling = 1,
  width = 6,
  ratio = 1.5,
  units = "in",
  dpi = 600,
  ...
)

Arguments

plot_object

A ggplot object

path

File name or file path to save the file; defaults to the working directory and the plot_object variable name

type

Type of file to save the graphic to; defaults to the path extension or PNG if no type or extension given

device

Which graphics device to use for saving; uses default devices for main file types

scaling

Scaling factor for the plot output, used to change the scaling of the entire rendered figure; specifically useful for resizing figures without altering relative image appearance or resolution; factor of 1 corresponds to a 6" x 4" image with 12 pt font; corresponds to the scaling argument in the ragg package

width

Width of plot image; default is 6"

ratio

Aspect ratio of plot image; default is 1.5

units

Units for plot width; default is "in"

dpi

Resolution for plot image in pixels per inch; default is 600

...

Other arguments to be passed to the graphics device function or ggsave


christyray/crthemes documentation built on April 14, 2023, 11:18 p.m.