title: Is there a way to capture whether any radio button has been clicked and react from it
body: <p>please refer to the reproducible code below.  Everything works fine up to one point.  If you select a team, and choose a weight through pushing the action buttons, and then click the populate button, a table appears with the weights.</p>
  <p>One thing though.  If you select, say team = a, and input +10%, and switch to team = b.  The input is still at +10%.  I'd like it to revert back to 0 so you always start anew.</p>
  <p>Anyway to do this?</p>
  <p>library(shiny)</p>
  <pre><code>library(dplyr)
  library(shinydashboard)
  library(shinydashboardPlus)
  library(shinyWidgets)
  
  df = data.frame(team = c(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;),
                  weights = c(0, 0, 0, 0))
  df
  
  ui = dashboardPage(
    header = dashboardHeader(title = &quot;teams&quot;),
    sidebar = dashboardSidebar(),
    body = dashboardBody(
      prettyRadioButtons(
        inputId = &quot;radio1&quot;,
        label = &quot;Select Teams&quot;,
        choices = df$team
      ),
      br(),
  
  div(style = &quot;margin-top: 10px;width: 100px; display: inline-block&quot;, textOutput(&quot;text1a&quot;)),
  div(
    style = &quot;width: 25px; display: inline-block; margin-left: 1px&quot;,
    actionBttn(
      inputId = &quot;action1a&quot;,
      size = &quot;xs&quot;,
      label = &quot;-&quot;,
      style = &quot;material-flat&quot;,
      color = &quot;primary&quot;
    )
  ),
  div(style = &quot;width: 25px; display: inline-block; margin-left: 10px; text-align: center&quot;, textOutput(&quot;text1b&quot;)),
  div(
    style = &quot;width: 25px; display: inline-block; margin-left: 25px&quot;,
    actionBttn(
      inputId = &quot;action1b&quot;,
      size = &quot;xs&quot;,
      label = &quot;+&quot;,
      style = &quot;material-flat&quot;,
      color = &quot;primary&quot;
    )
  ),
  br(),
  br(),
  
  actionBttn(
    inputId = &quot;populate&quot;,
    size = &quot;xs&quot;,
    label = &quot;Populate Weights&quot;,
    style = &quot;material-flat&quot;,
    color = &quot;danger&quot;
  ),
  br(),
  br(),
  div(style = &quot;width: 800px; margin-left: 10px&quot;, tableOutput(&quot;table1&quot;))
     ))  # End of Dashboard Body and Page
  
  server = function(input, output, session) {
    rv = reactiveValues(action1 = 0, df = df)
    
    output$text1a = renderText(paste(&quot;Team&quot;, input$radio1, sep = &quot; &quot;))
    
    rv$action1 = eventReactive(c(input$action1a, input$action1b),
                               {
                                 min(max(-5 * input$action1a + 5 * input$action1b,-50),50)
                               })
    
    output$text1b = renderText({
      if (rv$action1() &gt;= 0) {
        paste(&quot;+&quot;, rv$action1(), sep = &quot;&quot;)
      }
      else {
        rv$action1()
      }
    })
    
    rv$df = eventReactive(
      input$populate,
      df &lt;&lt;- rbind(
        df %&gt;% filter(team == input$radio1) %&gt;% mutate(weights = rv$action1()),
        df %&gt;% filter(team != input$radio1)
      ) %&gt;% arrange(team)
    )
  
    output$table1 = renderTable({
      rv$df()
    }) 
  }
  
  shinyApp(ui = ui,
           server = server,
           options = list(launch.browser = T))
  </code></pre>