title: Can I update the label of a downloadButton in shiny?
body: <p>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.</p>
  <p>Basically,</p>
  <pre><code>ui &lt;- fluidPage(
    checkboxInput(&quot;use_avg&quot;, &quot;Use averages&quot;),
    actionButton(&quot;b1&quot;, &quot;Download&quot;),
  
  )
  
  server &lt;- function(input, output, session) {
     observeEvent(input$use_avg, {
      if (input$use_avg == TRUE) {
        updateActionButton(inputId = &quot;b1&quot;, label = &quot;Download averages&quot;)
      } else {
        updateActionButton(inputId = &quot;b1&quot;, label = &quot;Download&quot;)
      }
    })
  }
  
  </code></pre>
  <p>Is there a way to do this with a downloadButton, or a way to use
  actionButton with downloadHandler?</p>