title: I am trying to select a subset of my data for a shiny app but the options are not visible
body: <p>I have a Shiny app which allows the user to select the x variable and y variable from the data, and it is split by another variable into different colours. This plots fine, but as there's lots of data it looks very messy.</p>
  
  <p>I want to plot a subset of my data by year, which is available in my dataset. I have used selectInput for this, but when I run that I get an empty dropdown box, and no data is plotted (presumably because nothing is selected).</p>
  
  <pre><code>server.R
  collated &lt;- read.csv("collated.csv")
  
  contVariables &lt;- c("percent_ctax_a_c" = "Percentage of population in council tax bands A - C",
                 "percent_ctax_d_e" = "Percentage of population in council tax bands D - E",
                 "percent_ctax_f_h" = "Percentage of population in council tax bands F - H",
                 "crimes_per_10000_popn" = "Crimes (per 10'000 population)",
                 "hosp_admissions_per_100000_popn" = "Hospital Admissions (per 100'000 population)",
                 "median_house_price_GBP" = "Median House Price (GBP)",
                 "mean_year_jobseekers_ages_25_49" = "Percentage of population aged 25-49 claiming Jobseekers Allowance",
                 "percent_waste_recycled" = "Percentage of waste recycled",
                 "waste_kg_per_capita" = "Waste per capita (kg)",
                 "percent_people_near_derelict" = "Percentage of people near derelict sites")
  
  shinyServer(function(input, output) {
  
  output$plot &lt;- renderPlot( {
      collated &lt;- subset(collated, year %in% input$year)
      p &lt;- ggplot(data = collated) +
          aes_string(x=input$x, y=input$y)
      p &lt;- p + geom_point(aes(col = collated$Council)) +
        labs(col="Local Authority") +
              xlab(contVariables[input$x]) + 
              ylab(contVariables[input$y])
      p
  } )    
  
  })
  </code></pre>
  
  <p>and</p>
  
  <pre><code>ui.R
  collated &lt;- read.csv("collated.csv")
  
  variables &lt;- list(
  continuous=c("Percentage of population in council tax bands A - C" = "percent_ctax_a_c",
               "Percentage of population in council tax bands D - E" = "percent_ctax_d_e",
               "Percentage of population in council tax bands F - H" = "percent_ctax_f_h",
               "Crimes (per 10'000 population)" = "crimes_per_10000_popn",
               "Hospital Admissions (per 100'000 population)" = "hosp_admissions_per_100000_popn",
               "Median House Price (GBP)" = "median_house_price_GBP",
               "Percentage of population aged 25-49 claiming Jobseekers Allowance" = "mean_year_jobseekers_ages_25_49",
               "Percentage of waste recycled" = "percent_waste_recycled",
               "Waste per capita (kg)" = "waste_kg_per_capita",
               "Percentage of people near derelict sites" = "percent_people_near_derelict"),
  
  categorical=c("Data zone" = "DataZone", 
               "Intermediate zone" = "InterZone", 
               "Local Authority" = "Council", 
               "Label" = "Label", 
               "Year" = "year")
  )
  
  fluidPage(
  titlePanel("Data"),
  sidebarLayout(
      sidebarPanel(
          selectInput("x", "Variable plotted on x-Axis", variables$continuous, selected ="percent_people_near_derelict"),
          selectInput("y", "Variable plotted on y-Axis", variables$continuous, selected ="median_house_price_GBP"),
          selectInput("year", "Year", choices = levels(collated$year), multiple = FALSE)),
      mainPanel(
          plotOutput("plot")
      )
      )
   )
  </code></pre>