Last active
August 23, 2016 10:07
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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