Learn R Programming

rstudioapi (version 0.17.0)

savePlotAsImage: Save active RStudio plot image

Description

Save the plot currently displayed in the Plots pane as an image.

Usage

savePlotAsImage(
  file,
  format = c("png", "jpeg", "bmp", "tiff", "emf", "svg", "eps"),
  width,
  height
)

Arguments

file

The target file path.

format

The Image format. Must be one of ("png", "jpeg", "bmp", "tiff", "emf", "svg", or "eps").

width

The image width, in pixels.

height

The image height, in pixels.