png()
, then func()
, then dev.off()
.
So func
must be a function that will generate a plot when used this
way.plotPNG(func, filename = tempfile(fileext = ".png"), width = 400,
height = 400, res = 72, ...)
.png
.png
. Note that this affects the
resolution of PNG rendering in R; it won't change the
actual ppi of the browser.png
. These can be used to set
the width, height, background color, etc.png
), then CairoPNG
,
and finally png
. This is in order of quality of
output. Notably, plain png
output on Linux and Windows may not
antialias some point shapes, resulting in poor quality output.In some cases, Cairo()
provides output that looks worse than
png()
. To disable Cairo output for an app, use
options(shiny.usecairo=FALSE)
.