Insert image (file or R object) into existing html file from R script
I include two ggplotly() graphics in a html file, eg. library(ggplot2) library(plotly) library(htmltools) g1 <- ggplot(data=data.frame(x=1:10, y=1:10)) + geom_point(aes(x=x, y=y)) g2 <- ggplot(data=data.frame(x=11:20, y=1:10)) + geom_point(aes(x=x, y=y)) l1 <- ggplotly(g1) l2 <- ggplotly(g2) htmltools::save_html(htmltools::tagList(l1,l2), file ="index.html") And now want to…