title: r shiny - Get radio button value as variable
body: <p>I am new with r shiny and I am trying to get selected value of a radio button as variable and then concatenate it with something else. Here is my code:</p>
  
  <p>ui.R</p>
  
  <pre><code>library(shiny)
  shinyUI(fluidPage(
    titlePanel("This is test app"),
  
    sidebarLayout(
      sidebarPanel(
        radioButtons("rd",
                     label="Select window size:",
                     choices=list("100","200","500","1000"),
                     selected="100")
      ),
      mainPanel(
           //Something
      )
    )
  ))  
  </code></pre>
  
  <p>server.R</p>
  
  <pre><code>library(shiny)
  
  shinyServer(function(input, output) {
  
  
    ncount &lt;- reactive({input$rd})
    print(ncount)
    my_var &lt;- paste(ncount,"100",sep="_")
  
  })
  </code></pre>
  
  <p>Now when I print <code>ncount</code> it prints out "ncount" rather than the value stored in the variable. Is there anything that I'm missing here.</p>
  
  <p>Thanks</p>