plotPNG {shiny}R Documentation

Capture a plot as a PNG file.

Description

The PNG graphics device used is determined in the following order:

Usage

plotPNG(
  func,
  filename = tempfile(fileext = ".png"),
  width = 400,
  height = 400,
  res = 72,
  ...
)

Arguments

func

A function that generates a plot.

filename

The name of the output file. Defaults to a temp file with extension .png.

width

Width in pixels.

height

Height in pixels.

res

Resolution in pixels per inch. This value is passed to the graphics device. Note that this affects the resolution of PNG rendering in R; it won't change the actual ppi of the browser.

...

Arguments to be passed through to the graphics device. These can be used to set the width, height, background color, etc.

Details

A NULL value provided to width or height is ignored (i.e., the default width or height of the graphics device is used).

Value

A path to the newly generated PNG file.


[Package shiny version 1.9.0 Index]