According to this thread: dygraph in R multiple plots at once I have learned how to make multiple chart using htmltools
package. Now I would like to save the output:
library(dygraphs)
library(htmltools)
library(quantmod)#to fetch data
library(lubridate)
getSymbols(c("AAPL","AMZN"))
dyg1 = dygraph(AAPL[paste(ymd("2015-01-01"),ymd("2020-01-01"),sep = "::"),6])
dyg2 = dygraph(AMZN[paste(ymd("2015-01-01"),ymd("2020-01-01"),sep = "::"),6])
jpeg("my_plot_name.jpg")
dy_graphs = list(dyg1,dyg2)
htmltools::browsable(htmltools::tagList(dy_graphs))
dev.off()
This code works however saved file is blank (white) jpg file. What am I doing wrong here?