savepng {arrayMagic} | R Documentation |
Save the contents of the current graphics device to a PDF or PNG file
savepng(fn, dir, width=480, asp=1) savepdf(fn, dir, width=6, asp=1)
fn |
character: name of the output file (without extension .png or .pdf) |
dir |
character: directory to which the file should be
written. If NULL , use the filename in fn only. |
width |
numeric: width of the image in pixels (png) or inches (pdf) |
asp |
numeric: aspect ratio; height=width*asp |
Character: name of the written file.
Wolfgang Huber http://www.dkfz.de/mga/whuber
x = seq(0, 20*pi, len=1000) plot(x*sin(x), x*cos(x), type="l") try({ ## on some machines, png or pdf may not be available savepdf("spiral", dir=tempdir()) ## Not run: savepng("spiral", dir=tempdir()) ## End(Not run) })