title: R shiny addition of points according to input
body: <p>I want to create an application where inputs are matched with a score. Here is my code:</p>
  <pre class="lang-r prettyprint-override"><code>library (shiny)
  library(shinyWidgets)
  library(fresh)
  library(htmltools)
  ui&lt;-navbarPage(&quot;Addition of points&quot;,
         tabPanel(&quot;Calculation&quot;,
                  
                  fluidPage(                            
                    headerPanel(h4(&quot;Scores&quot;)), 
                    headerPanel(h5(&quot;Please select your inputs.&quot;)),
                    
                    fluidRow(
                      (column (3, 
                               
                               headerPanel(h5(strong(&quot;Score1&quot;))),
                               
                               sliderInput(&quot;score1&quot;, label = h6(&quot;Score1 (1-3), input &lt;=2 should add 6 points to the total score, input &gt;2 should add no points&quot;), min = 1, max = 3, value = 1, ticks = TRUE, animate=TRUE, step = 1, width = &quot;150px&quot;)                                      
                               
                      )),
                      (column (3,
                               
                               headerPanel(h5(strong(&quot;Score2&quot;))),
                               
                               numericInput(&quot;score2&quot;, label = h6(&quot;Score2, input &lt;=10 should add 5 points to the total score, input &gt;10 should add no points&quot;), value = &quot;1&quot; , width = &quot;150px&quot;)
                               
                      )),
                      (column (3,
                               headerPanel(h5(strong(&quot;Score3&quot;))),
                               radioButtons(&quot;score3&quot;, label = h6(&quot;Score3, clicking on 'No' should add 4 points to the total score, clicking on 'Yes' should add no points&quot;), choices = list(&quot;No&quot;=1, &quot;Yes&quot;=2), selected = character(0))
                               
                               
                      )),
                      (column (2,                                         
                               wellPanel(
                                 style = &quot;background: white&quot;, 
                                 headerPanel(h4(strong(&quot;Score:&quot;))),                                             
                                 textOutput(&quot;multi&quot;)                                             
                               )))
                    )))
  )
  server&lt;-function(input, output) {
      B=function(x, y){
          if(input$score1&lt;=2) {+6}
          if(input$score2&lt;=10) {+5}
          if(input$score3==1) {+4}
      }
      output$multi &lt;- renderText ({ B() })
  }
  shinyApp(ui, server)
  </code></pre>
  <p>Can anyone help with the function how to add the points to the total score? The maximum total score would be 15 points. Thank you so much.</p>