sliderInput("bins", "Number of bins:", min =1, max =50, value =30)downloadLink('downloadData', 'Download')plotOutput("distPlot")## https://stackoverflow.com/questions/74947736/## how-to-download-quarto-pdf-reports-from-r-## shiny-application
1
downloadLink was appearing but downloadButton was not last week - ran out of time before could fully explore
All elements within this chunk are executed when the document is rendered
output$distPlot <-renderPlot({ x <- faithful[, 2] # Old Faithful Geyser data bins <-seq(min(x), max(x), length.out = input$bins +1)hist(x, breaks = bins, col ='darkgray', border ='white',xlab ='Waiting time to next eruption (in mins)',main ='Histogram of waiting times')})output$downloadData <-downloadHandler(filename =function() {paste('data-', Sys.Date(), '.csv', sep='') },content =function(con) {write.csv(data, con) } )
1
Ran out of time last week, but downloadHandler seemed like a promising Plan A