Created
January 30, 2019 07:48
-
-
Save zeehio/521de08708870c24f5dca478a92818c5 to your computer and use it in GitHub Desktop.
Save the plotly plot as html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Plots in WebGL | |
#' @param plt A plot created with plotly or ggplot2 | |
#' @param html_filename The file name where the plot will be saved | |
#' | |
#' @return The html_filename | |
#' @export | |
#' | |
plot_interactive <- function(plt, html_filename) { | |
htmltools::save_html( | |
html = htmltools::as.tags( | |
x = plotly::toWebGL(plt), | |
standalone = TRUE), | |
file = html_filename) | |
html_filename | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment