as.pngpdf: Wrapper around gglplot2::ggsave with presets.

View source: R/plot_wrappers.R

as.pngpdfR Documentation

Wrapper around gglplot2::ggsave with presets.

Description

Wrapper around gglplot2::ggsave with presets.

Usage

as.pngpdf(
  filename,
  plot = ggplot2::last_plot(),
  scale = 1,
  width = 12,
  height = 8,
  units = "in",
  dpi = 400
)

Arguments

filename

File name to create on disk.

plot

Plot to save, defaults to last plot displayed.

scale

Multiplicative scaling factor.

width, height

Plot size in units expressed by the units argument. If not supplied, uses the size of the current graphics device.

units

One of the following units in which the width and height arguments are expressed: "in", "cm", "mm" or "px".

dpi

Plot resolution. Also accepts a string input: "retina" (320), "print" (300), or "screen" (72). Applies only to raster output types.

Value

A plot saved as .png and .pdf, returns nothing.


JokingHero/rxtras documentation built on April 1, 2024, 12:42 p.m.