O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

To send the graphic output to the computer screen, you have to do nothing special. For other devices, you first open the device, send your graphical output to it, and then close the device to close the corresponding file.

To create a PostScript file, see the following code:

> postscript(file = "auto-scatter.ps")> boxplot(mpg)> dev.off()> pdf(file = "auto-scatter.pdf")> boxplot(mpg)> dev.off()> png(file="mpg-boxplot.png",width=400,height=350,res=72)> boxplot(mpg)> dev.off()

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required