title: Shiny R Unique Field Values as Dropdown Items
body: <p>I would like to create the selectInput dropdown list from the unique values of a field i.e. without having to enumerate them all. How does one do that?</p>
  
  <p>For instance, in this trivial example if I had the following data.frame, state_data:</p>
  
  <pre><code>State  V1
  MA     1   
  MA     2
  MA     54
  VA     1 
  NC     4
  VA     4 
  NC     20
  </code></pre>
  
  <p>I would want the dropdown options to be MA,VA,NC and then on the server side I would want it to correspond to that selected subset of the data.frame.</p>
  
  <p><strong>UI.r</strong></p>
  
  <pre><code>library(shiny)
  shinyUI(pageWithSidebar(
  headerPanel("State Data"),
  
  
  sidebarPanel(
  selectInput("variable","State:",
  list(State)),
  
  ),
  
  
   mainPanel()
  
  
  ))
  </code></pre>
  
  <p><strong>Server.r</strong></p>
  
  <pre><code>library(shiny)
  
  
  state_data &lt;- read.csv("dummy.csv",header=T)
  State &lt;- factor(state_data$state)
  State &lt;- levels(State)
  
  
  shinyServer(function(input, output) {
  
  
  
  })
  </code></pre>