download_server | R Documentation |
The server component of the Shiny module for creating a pretty download button for downloading a csv, png, or jpg file.
download_server(id, obj, fname = "download", ftype = "csv", ...)
id |
String. The input slot that will be used to access the value. |
obj |
The object to be saved. Either a data frame, a blob of text, or a ggplot2 object. |
fname |
String. Name of the file under which to save the object. |
ftype |
String. Type of the file to save. One of three values: 'csv' (default), 'png', 'jpg'. |
... |
Arguments that can be passed into 'ggplot2::ggsave()'. For example 'dpi' (image resolution), 'width', and 'height'. |
A module server function that can be called in a reactive env.
download_ui
for the UI.
inst/examples/ex-download.R
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.