title: Shiny App to Run Simple Regression-Error: Reading objects from shinyoutput object not allowed
body: <p>I am new to shiny but I am trying to write a shinyapp that allows users to choose a dependent variable and select a number of independent variables and the app outputs the regression table. </p>
  
  <p>Currently the code I have looks like the following. </p>
  
  <p>ui.R </p>
  
  <pre><code># Define UI for application 
  
  shinyUI(fluidPage( 
  
  #application title 
  
  titlePanel("Data Analysis Write-Up"), 
  
  #sidebar 
  
  sidebarLayout( 
      sidebarPanel( 
  
          textInput("name", label=h5("Name"), value="Name"), 
          HTML('&lt;/br&gt;'), 
          selectInput("dv", h5("Choose a dependent variable:"), 
                  choices = c("Female Legislators", "Literacy Rate", "Renewable Resources")),
          HTML('&lt;/br&gt;'), 
          checkboxGroupInput("iv", label= h5("Independent Variables"), 
                  choices = list("GDP per capita"= 1, "Population"=2, "Poverty"=3),
                  selected= c(1,2,3)), 
          HTML('&lt;/br&gt;'), 
          radioButtons('format', h5("Document Format"), c('PDF', "Word"), inline=T), 
          downloadButton('downloadReport')),
  
  #main panel 
  
  mainPanel(
  
          tabPanel("Model",                   
                         verbatimTextOutput("model"),
                         textInput("text_model", label = "Interpretation", value = "Enter text..."))
                  )
   ))))
  </code></pre>
  
  <p>server.R </p>
  
  <pre><code>shinyServer(function(input, output) {
  
  
  load("/Users/KimFruge/Desktop/CPO2002Sum2016/Lectures/Writing Assignment/dat.RData")
  
  #Dependent Variables 
  
  output$dv &lt;- reactive({ switch(input$dv, 
      "Female Legislator"= SG.GEN.LSOM.ZS, 
      "Literacy Rate" =  SE.ADT.LITR.ZS,
            "Renewable Resources" = EG.ELC.RNWX.ZS) 
  })
  
  
  #Independent Variables
  
  
  x&lt;-c("NY.GDP.PCAP.CD", "SP.POP.TOTL", "SI.POV.2DAY") 
  
  output$iv&lt;- reactive({ x[input$iv] }) 
  
  #data 
  
  temp&lt;- reactive({ 
  
        dat[, c("country", "year", output$dv, output$iv)]
  
        })
  
  
  #regression formula 
  
            regFormula&lt;- reactive({ 
  
                      as.formula(paste(output$dv, '~', output$iv))
  
                  })
  
  #Regression Model 
  
      model&lt;- reactive ({ 
  
           lm(regFormula(), data = temp())
  
       })
  
  #model 
  
  
      output$model &lt;- renderPrint({ summary(model())}) 
  
    })
  
   })
  </code></pre>
  
  <p>The app runs and the side panel shows up like I want it to but I get the error "Reading objects from shinyoutput object not allowed".</p>
  
  <p>I have done some troubleshooting but I cannot seem to find what is producing this error. If anyone has any advise on where to look for errors or what common mistakes that produce this error might be I would greatly appreciate it! Thanks in advanced! </p>
  
  <p>Note: The data for this project was simply downloaded from world bank indicators. </p>