block by timelyportfolio c8b2ea18d227d7f9761f

dynamically change favicon in browser with shiny and R.devices

Favicon from Plot in R Shiny

Once I saw R.devices function toFavicon I just had to figure out how to use it to dynamically change the favicon with a plot from R. Here is one way to accomplish it, but note the dangerous eval(parse(...)) in line 14, so be careful if you are using for nonpersonal use.

Non-Shiny Use

For non-shiny use, we can see it work with htmltools.

library(htmltools)
library(R.devices)

html_print(
  HTML(
    toFavicon( plot(1:10) )
  )
  ,viewer = browseURL #  since RStudio Viewer doesn't show favicon open in browser
)

code.R