R/plotly.R

Defines functions dump_plot

##' .. content for \description{} (no empty lines) ..
##'
##' .. content for \details{} ..
##' @title 
##' @param p 
##' @param path 
##' @return 
##' @author WTFRR04881L
##' @export
dump_plot <- function(p, path) {
  cur <- getwd()
  tryCatch({
    setwd(dirname(path))
    htmlwidgets::saveWidget(plotly::as_widget(p),
                            file=basename(path))
    message(glue::glue("[[file:{path}]]"))
  },
  finally = {setwd(cur)}
  )
}
cayek/cayekR documentation built on July 27, 2019, 2:04 p.m.