as.png.default: Convert to PNG by Default

Description Usage Arguments Value See Also Examples

View source: R/default.R

Description

Converts object to PNG. By default, device is scaled by plot size. Device is automatically closed and filename argument is returned.

Usage

1
2
3
4
5
6
## Default S3 method:
as.png(x, width = getOption("plotscale_png_width", 3),
  height = getOption("plotscale_png_height", 3), devsize = if (scaled)
  "devsize" else "unscaled", res = getOption("plotscale_res", 300),
  units = "in", scaled = getOption("plotscale_scaled", TRUE),
  filename = "Rplot%03d.png", ...)

Arguments

x

object

width

desired plot width

height

desired plot height

devsize

a function of x, width, height, and ... that calculates device size

res

passed to png

units

NOT passed to png; width and height always treated as inches regardless

scaled

whether to rescale width and height by plot size

filename

file name passed to png

...

other arguments to png and devsize

Value

(invisible) the filename argument

See Also

Other as.png: as.png

Other devices: as.pdf.default, as.pdf, as.png

Examples

1
2
3
4
options(example.ask = FALSE)
options(device.ask.default = FALSE)
library(lattice)
as.png(xyplot(2~3), filename = tempfile())

plotscale documentation built on May 2, 2019, 6:50 a.m.