R HTMLWidgets in Jupyter Notebooks

A quick note for displaying R htmlwidgets in Jupyter notebooks without requiring pandoc – there may be a more native way but this acts as a workaround in the meantime if not:

library(htmlwidgets)
library(IRdisplay)

library(leaflet)
m = leaflet() %>% addTiles()
saveWidget(m, 'demo.html', selfcontained = FALSE)
display_html('<iframe src="demo.html"></iframe>')

PS and from the other side, using reticulate for Python powered Shiny apps.

3 comments

  1. Pingback: R HTMLWidgets in Jupyter Notebooks – Mubashir Qasim
  2. Pingback: First Class R Support in Binder / Binderhub – Shiny Apps As Well as R-Kernels and RStudio | Smart Solution 4.0
  3. Pingback: First Class R Support in Binder / Binderhub – Shiny Apps As Well as R-Kernels and RStudio | R-bloggers