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.
Returns
A path to the newly generated PNG file.
Details
A NULL value provided to width or height is ignored (i.e., the default width or height of the graphics device is used).