title: server.R undefined columns?
body: <p>I'm trying to create a R Shiny app and have encountered the error:</p>
  
  <pre><code>Error in `[.data.frame`(dataset.temp, , input$col) : 
    undefined columns selected
  </code></pre>
  
  <p>I'm not sure what's causing this, hopefully someone could help me figure it out. Here's a sample code:</p>
  
  <p>ui.R</p>
  
  <pre><code>shinyUI(fluidPage(
    titlePanel("Data"),
    sidebarLayout(
      sidebarPanel(
        textInput("from","Missing",
                  value="Enter characters"),
        textInput("to","Missing",
                  value="Enter characters"),
        selectInput("col","Select Column",
                    choices = c(1:6),
                    selected=1)),
      mainPanel(
        tableOutput('contents')
      )
    )
  ))
  </code></pre>
  
  <p>server.R</p>
  
  <pre><code>library(DT)
  file &lt;- read.csv("file.csv")
  shinyServer(function(input, output) {
  dataset.temp &lt;- file
  output$contents &lt;- renderTable({
  dataset.temp[,input$col] &lt;- gsub(input$from,input$to,dataset.temp[,input$col])
      dataset.temp
    })
  })
  </code></pre>
  
  <p>Any thoughts?</p>