how to save a plot to a file in R
2014-08-29++ how to save a plot to a file in R
how to save a ggplot() from command line in R
png("C:\Users\kwhittem\Desktop\temp\myplot.png")
....plot code here....
dev.off()
^this file will be placed in the current working directory which can be found with
getwd()
The directory can be set with
setwd(dir)
png("myplot.png", height = 800, width = 600)
ggplot() +
geom_boxplot(aes(y = entropy,x = Classification),data=table_of_summary_numbers_clean_100913d1421) +
coord_flip() +
geom_dotplot(aes(x = Classification,y = entropy),data=table_of_summary_numbers_clean_100913d1421,alpha = 0.5043,binaxis = 'y',binwidth = 0.01,stackdir = 'center')
dev.off()