knitr::opts_chunk$set(echo = TRUE) library(plotly) library(ggplot2) library(magrittr) library(knitrContainer)
container <- knitrContainer() for (i in 1:2) container %<>% add_as_plotly_widget(obj = ggplotly(qplot(1:5,1:5))) print_all(container)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.