I have around 17 unique store names. I wish to write a function such that for each facet_wrap with respect to each store, it should write a plot separately and save it as jpeg.
For example: The function should be able to write jpeg for each store for variable
vs value
. Thus there should be 17 such jpeg outputs.
df_melt = melt(df,id = c("Store", "series"))
names = unique(df_melt$Store)
df = fread('Book3.csv',sep = "auto")
ggplot(df_melt, aes(x=variable, y = value))+
geom_path(aes(group=series, color = series))+
geom_point(aes(color = series))+
coord_cartesian()+
theme(axis.text.x=element_text(angle=90,hjust=1,vjust=0.5))+
facet_wrap(~Store,scales = "free_y")
names
[1] 612 1074 1254 1541 1544 1710 1770 3887 4101 4149 4415 4940 6612 6646 6934 8582 8941
I hope I am able to ask my question properly. Please members help me out.