Not sure if this might be useful to anyone but thought I would post it anyways. I thought it would be nice to be able to get all the images from the RStudio plots tab. On Windows, these are stored in tempdir()
, so with some list.files
, grepl
, tag
, and base64enc::dataURI
, we could make an HTML page with all the charts. Where I think this will be most useful will be in an htmlwidget
lightbox or something similar as an alternative and possibly more pleasant viewing experience.
library(htmltools)
html_print(lapply(
list.files(tempdir(),"png",recursive=T,full.names=T)
,function(p){
if(grepl(x=p,pattern="rs-graphics") && !(grepl(x=p,pattern="empty"))){
tag("img",c(src=base64enc::dataURI(file=p)))
}
}
))