I have a web app that does some transformation and allows the user to control it, and then download the results. I want to update the label on the button so that the user knows the content that he will download.
Basically,
ui <- fluidPage(
checkboxInput("use_avg", "Use averages"),
actionButton("b1", "Download"),
)
server <- function(input, output, session) {
observeEvent(input$use_avg, {
if (input$use_avg == TRUE) {
updateActionButton(inputId = "b1", label = "Download averages")
} else {
updateActionButton(inputId = "b1", label = "Download")
}
})
}
Is there a way to do this with a downloadButton, or a way to use actionButton with downloadHandler?