Plot to the pdf and png devices at once.

pdfpng(expr, fn)

Arguments

expr
A quoted expression that produces the desired plot.
fn
The file name (without extension).

Value

Produces the files fn.pdf and fn.png.

Examples

p <- quote({ plot(1:10) points(10:1) }) pdfpng(p, "myfig")
#> pdf #> 2