June 2016
Beginner to intermediate
1783 pages
71h 22m
English
In this recipe, you will learn how to save and export our graphs to various useful formats.
To save a graph as an image file format such as PNG, we can use the png() command:
png("scatterplot.png")
plot(rnorm(1000))
dev.off()The preceding command will save the graph as scatterplot.png in the current working directory. Similarly, if we wish to save the graph as JPEG, BMP, or TIFF, we can use the jpeg(), bmp(), or tiff() commands, respectively.
If you are working in Windows, you can also save a graph using the graphical user interface. First, make your graph, make sure that the graph window is the active window by clicking anywhere inside it, and then navigate to File | Save as | Png or the format of your ...
Read now
Unlock full access