I need to export around 100 graphs in a pdf everyday. I want to make a function to combine multiple functions into a single function so I can run it easily everyday Following is my function, chartSeries95 mean 95 different object (not in order...)
chartSeries95 <-
function(x,y) {
pdf (file=paste(format(Sys.time(), "%Y-%m-%d %I-%p"), "pdf", sep = "."))
chartSeries(`H0001_xts`, theme="white", TA="addVo();addBBands();addCCI();addRSI();addMACD()", subset='last x weeks')
chartSeries(`H0001_xts`, theme="white", TA="addVo();addBBands();addCCI();addRSI();addMACD()", subset='last y weeks')
...
dev.off()
}
In the above example, I need to plot the same object for two different parameters x,y. My ideal output is I can view hundreds of stocks in a single pdf file (with the name like this, YYYY-MM-DD.pdf) with different time periods x,y. Thanks.