June 2016
Beginner to intermediate
1783 pages
71h 22m
English
In this recipe, we will learn how to save graphs in high-resolution image formats for use in presentations and publications.
We will only use the base graphics functions for this recipe. So, just run the R code at the R prompt. You might wish to save the code as an R script so that you can use it again later.
Let's re-create a simple scatter plot example from Chapter 1, R Graphics, and save it as a PNG file 600 px high and 600 px wide with a resolution of 200 dots per inch (dpi):
png("cars.png",res=200,height=600,width=600) plot(cars$dist~cars$speed, main="Relationship between car distance and speed", xlab="Speed (miles per hour)",ylab="Distance ...Read now
Unlock full access