title: R - Shiny Package - Non-numeric argument to binary operator
body: <p>I'm pretty new to using R and I'm just testing out some things with the Shiny package. In my application I request the user to give some inputs, based on these inputs the application has to make some calculations.</p>
  
  <p>The input gets asked from the user in the following way (ui.R code)</p>
  
  <pre><code>library(shiny)
  shinyUI(fluidPage(
        titlePanel("Shiny Test application"),
        # The layout
        fixedRow(
          column(9,
             radioButtons("data",label = "Data", list("Onbelangrijk", "Minder belangrijk", "Neutraal", "Belangrijk", "Zeer belangrijk"), "", inline = TRUE),
             radioButtons("visualisatie",label = "Visualisation", list("Onbelangrijk", "Minder belangrijk", "Neutraal", "Belangrijk", "Zeer belangrijk"), "", inline = TRUE),
             radioButtons("price",label = "Price", list("Onbelangrijk", "Minder belangrijk", "Neutraal", "Belangrijk", "Zeer belangrijk"), "", inline = TRUE),
             radioButtons("self",label = "Self-service", list("Onbelangrijk", "Minder belangrijk", "Neutraal", "Belangrijk", "Zeer belangrijk"), "", inline = TRUE),
  </code></pre>
  
  <p>Below represents my server.R code.</p>
  
  <p>Example how the values of the input are generated:</p>
  
  <pre><code>     data &lt;- reactive({
        if(input$data == "Onbelangrijk") {
          data &lt;- 1
        } else if (input$data == "Minder belangrijk") {
          data &lt;- 3
        } else if (input$data == "Neutraal") {
          data &lt;- 5
        } else if (input$data == "Belangrijk") {
          data &lt;- 7
        } else {
          data &lt;- 9
        } })
  
  visualisatie &lt;- reactive({
      if(input$visualisatie == "Onbelangrijk") {
        visualisatie &lt;- 1
      } else if (input$visualisatie == "Minder belangrijk") {
        visualisatie &lt;- 3
      } else if (input$visualisatie == "Neutraal") {
        visualisatie &lt;- 5
      } else if (input$visualisatie == "Belangrijk") {
        visualisatie &lt;- 7
      } else {
        visualisatie &lt;- 9
      } })
  </code></pre>
  
  <p>The values for price and self get derived in the same way.</p>
  
  <p>Putting this input into a vector:</p>
  
  <pre><code>criteria &lt;- c(data, visualisatie, price, self)
  </code></pre>
  
  <p>Generating needed matrix to use AHP formula :</p>
  
  <pre><code>  MATR &lt;- matrix(criteria, nrow = 4, ncol = 4)
    MATR2 &lt;- t(t(MATR)/criteria)
  </code></pre>
  
  <p>This results in the following error message:</p>
  
  <pre><code>Error in t(MATR)/criteria : non-numeric argument to binary operator
  </code></pre>
  
  <p>I think the error is because of the vector created earlier.
  I already tried to use the following functions:</p>
  
  <pre><code>criteria &lt;- as.numeric(criteria)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>criteria &lt;- as.numeric(unlist(criteria))
  </code></pre>
  
  <p>But those resulted in the following error:</p>
  
  <pre><code>(list) object cannot be coerced to type 'double'
  </code></pre>
  
  <p>Another weird thing is that when I execute the code in the R console, all works fine.
  However when I use the code in a shiny application, the application crashes with the 'non-numeric argument to binary operator code' error.</p>