I am on a quest for knowledge regarding the inclusion of a download button in my application that consolidates various files into a zip archive.
Within my application, there are a timeline and a datatable, with files linked to entries on the datatable. These files are stored in a directory within the app, with filenames listed in a column of the datatable.
The plan is to generate a zip archive containing a selection of standard files, a csv version of the datatable, a png image of the timeline, and any files associated with the chosen entries from the datatable upon clicking the download button.
I have yet to address the files associated with the datatable entries, but that is my ultimate goal.
Current Code
library(shiny)
library(timevis)
library(lubridate)
library(dplyr)
starthour <- 8
today <- as.character(Sys.Date())
todayzero <- paste(today,"00:00:00")
todayAM <- paste(today,"07:00:00")
todayPM <- paste(today, "18:00:00")
items <- data.frame(
category = c("Room","IceBreaker","Activity","Break"),
group=c(1,2,3,4),
className = c ("red_point", "blue_point", "green_point","purple_point"),
content = c("Big Room","Introductions","Red Rover","Lunch"),
length = c(480,60,120,90)
)
...
EDIT
At present, the method I am employing to download selected rows from a datatable in my live application is as follows:
output$downloadData2 <- downloadHandler(
filename = function() {paste('Selected Retreat Options', Sys.Date(), '.csv', sep = '')},
content = function(file){ write.csv(thedata()[input[["tbl1_rows_selected"]], ],file)})