if (FALSE) {
library(ggplot2)
p <- ggplot(mtcars, aes(mpg, wt)) + geom_point()
savePlotToFile(p, "my_plot.png")
savePlotToFile(p, "my_plot.pdf", format = "pdf")
savePlotToFile(p, "high_res.png", dpi = 300)
}
Run the code above in your browser using DataLab