Skip to content

Instantly share code, notes, and snippets.

@AndreaCirilloAC
Last active August 23, 2016 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreaCirilloAC/8a0efe2b120ac01f2526a79f2ab33678 to your computer and use it in GitHub Desktop.
Save AndreaCirilloAC/8a0efe2b120ac01f2526a79f2ab33678 to your computer and use it in GitHub Desktop.
this code produce a semi-automated workflow to create and saw plots at a custom location with png format.
library(dplyr)
library(ggplot2)
create_file <- function(name){
path <- paste(getwd(),"/",name,".png",sep = '') %>%
file.path() %>% png(,width=960,height=480)
}
#this is the template: change the theme (and the name argument) to produce the other plots
create_file(name = "theme_bw")
ggplot(data=diamonds, aes(carat,price ))+
geom_point(aes(colour= color))+
theme_bw()
dev.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment