0

I am trying to include some plots built using plotly in slides generated from .Rmd using slidify.
The problem is that the plots are rendered as images instead of being interactive.
On the same .Rmd file if instead of using slidify to produce html slides I use knitr to produce an ordinary html pages the plotly plots are interactive.

To produce the slides (with plot images instead of desired normal itneractive plot) I am using slidify with the following commands:

slidify("a.Rmd"); browseURL("b.html")

To produce the normal html page (that correctly shows the interactive plotly plots) I am using:

rmarkdown::render("a.Rmd"); browseURL("a.html")

1 Answers1

0

you can save your widget
htmlwidgets::saveWidget(as.widget(p), file = "plot.html")
then insert it in the slidify in an iframe, more info here
https://plot.ly/r/embedding-plotly-graphs-in-HTML/

s.brunel
  • 1,003
  • 10
  • 24
  • Thank you, is that the workaround for an integration problem between slidify and plotly or the "standard" way? –  Mar 30 '17 at 07:34
  • it's working as intended for me maybe you need to update your package – s.brunel Mar 30 '17 at 07:40
  • I was following the instructions of the page you quoted before posting, it reads; "If you're using knitr/R Markdown with HTML output, printing not only creates the plot, but also embeds it as an HTML iframe." and that happens with knitr, but not with slidify, so this still seems an integration problem, more likely to be in slidify than on plotly as knitr works correctly –  Mar 30 '17 at 07:45
  • It's ok, the fact that you tried to help is .. very positive, thanks –  Mar 31 '17 at 09:47