title: Printing output based on dynamic user input in R Shiny
body: <p>I am quite new to R shiny and so have not been able to figure out the solution from similar questions posted on this site. I am trying to read and use the input that a user provides to R shiny to generate an output.</p>
  
  <p>I am trying to create a simple GUI where a user selects the name of a person (from a drop-down menu) and then enters his/her weight. If the height is above a  certain threshold the output recommendation is "Gain Weight", else it is "Loose Weight".</p>
  
  <p>Everything seems to be working fine, except for the following error from the Server.R file: </p>
  
  <pre><code> Error in `$.shinyoutput`(output, value_weight) : 
   Reading objects from shinyoutput object not allowed
  </code></pre>
  
  <p>How can I read and use the variable 'value_weight' in an if-then-else condition?</p>
  
  <p><strong>Main.R</strong></p>
  
  <pre><code>library(shiny)
  runApp()
  </code></pre>
  
  <p><strong>Server.R</strong></p>
  
  <pre><code>function(input, output) {
  
   # You can access the value of the widget with input$select, e.g.
   output$value_name   &lt;- renderPrint({ input$select })
   output$value_weight &lt;- renderPrint({ input$num })
  
   if(output$value_weight &gt; 150)
   {
     output$value_recommendation &lt;- "Loose Weight"
   }
   else{
     output$value_recommendation &lt;- "Gain Weight"
   }
  
   }
  </code></pre>
  
  <p><strong>UI.R</strong></p>
  
  <pre><code> names_list &lt;- list("Adam", "Jenna","Peter")
  
   fluidPage(
   selectInput("select", label = h3("Select Name"), choices = names_list, selected = 1),
  
   hr(),
   fluidRow(column(3, verbatimTextOutput("value_name"))),
   numericInput("num", label = h3("Enter Weight"), value = 0),
  
   hr(),
   fluidRow(column(3, verbatimTextOutput("value_weight"))),
  
   hr(),
   fluidRow(column(3, verbatimTextOutput("value_recommendation")))
  
     )
  </code></pre>