Thanks! That's what I'm trying to do. It turned out to be
uiOutput("downloadData")
on the ui side and
output$downloadData <- renderUI({
req(input$submit1, mydata())
downloadButton("downloadData01")
})
on the server side, with the download button server definition:
output$downloadData01 <- downloadHandler(
filename = function() {
paste(input$myquery, ".csv", sep = "")
},
content = function(file) {
write.csv(mydata(), file, row.names = FALSE)
}
)