title: Cannot populate drop down menu dynamically in R shiny
body: <p>I am trying to create an APP using R Shiny. I want to upload data (.csv file). Then I want to populate the column names in CSV file in a drop down menu. I am unable to do that.</p>
  
  <p>Please refer to the codes below : </p>
  
  <p>---- server.r -----</p>
  
  <pre><code>library(shiny)
  options(shiny.maxRequestSize = 32*1024^2)
  
  
  shinyServer(
  
  
  function(input, output){ 
  
  data &lt;- reactive({
    file1 &lt;- input$file
    if(is.null(file1)){return()} 
    read.table(file=file1$datapath,head=TRUE,sep=",")
  
  })
  
  output$sum &lt;- renderTable({
    if(is.null(data())){return ()}
    summary(data())
  
  })
  
  output$table &lt;- renderTable({
    if(is.null(data())){return ()}
    data()
  })
  
  # the following renderUI is used to dynamically generate the tabsets when the file is loaded. Until the file is loaded, app will not show the tabset.
  output$tb &lt;- renderUI({
    if(is.null(data()))
      h5("no file loaded")
    else
      tabsetPanel(tabPanel("Data", tableOutput("table")),tabPanel("Summary", tableOutput("sum")))
  })
  
     output$col &lt;- renderUI({
  
    selectInput("phenomena", "Select the Phenomena",  names(data))
    })
  
  })  
  </code></pre>
  
  <p>----- ui.R -----</p>
  
  <pre><code> library(shiny)
  
  
   shinyUI(fluidPage(
  
   titlePanel("Hotspot Analysis of EnviroCar Data"),
   sidebarLayout(
   sidebarPanel(
  
    # uploading the file 
     fileInput("file","Upload *.csv file"), # fileinput() function is used to get the file upload contorl option
  
    uiOutput("col")
  
  
  ),
  
  mainPanel(  uiOutput("tb") )
  
  )
  
  ))
  </code></pre>