#' Shiny download ggplot
#'
#' @param curv2plot ggplot to plot
#' @import grDevices
#' @return function for download ggplot
#' @export
plot_downloads <- function(curv2plot) {
filename <- file <- NULL
downloadHandler(
filename = function() {
paste(Sys.Date(), "_kv_plot", ".png", sep="")
},
content = function(file) {
grDevices::png(file,
width = 960,
height = 480,
units = "px",
pointsize = 24)
plot(curv2plot)
dev.off()
}
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.