I am creating an html document by creating various objects with ggplotly()
and htmltools functions like h3()
and html()
. Then I submit th
If you want to save the plot as a dynamic plotly
graph, you could use htmlwidgets::saveWidget
. This will produce a stand-alone html file.
Here is a minimal example:
library(tidyverse);
library(plotly);
library(htmlwidgets);
df <- data.frame(x = 1:25, y = c(1:25 * 1:25))
gg <- ggplot(df,aes(x = x, y = y)) + geom_point()
# Save ggplotly as widget in file test.html
saveWidget(ggplotly(gg), file = "test.html");