inst/app/downloadPlot.R

# ==== Fungsi umum untuk download plot ====
make_download_plot <- function(plot_reactive, filename_prefix) {
  downloadHandler(
    filename = function() {
      paste0(filename_prefix, "_", Sys.Date(), ".png")
    },
    content = function(file) {
      ggsave(file, plot = plot_reactive(), width = 8, height = 5, dpi = 300)
    }
  )
}

Try the measureR package in your browser

Any scripts or data that you put into this service are public.

measureR documentation built on May 15, 2026, 9:06 a.m.