title: ShinyApp:Why do the outcomes change in ggplot when more than one input is selected?
body: <p>I am creating a <em>ShinyApp</em> for a yearly performance assessment of various workers and would like to show the performance (salespermonth) of one or multiple workers(W) based on the input selected. However, I am experiencing changing values for the same "W" when more than one "W" is selected in the sidebarPanel. Does anyone know why?</p>
  
  <p>There somehow seems to be a problem with the reactive function of <code>data.b</code>, more precisely the part, where <code>ID==input$ID</code>.</p>
  
  <p><code>data.frame</code> sample (ID goes from 1-10):</p>
  
  <pre><code>  ID Calendartime timewithfirm salespermonth cumm.sales
  1  1   2006-01-01            3           800        800
  2  1   2006-02-01            3           300       1100
  3  1   2006-03-01            3           150       1250
  4  1   2006-04-01            3           200       1450
  5  1   2006-05-01            3           350       1800
  6  1   2006-06-01            3           100       1900
  </code></pre>
  
  <p><strong>ui.R</strong>   </p>
  
  <pre><code>library(shiny)
  shinyUI(pageWithSidebar( 
  headerPanel(title=h1("Worker Performance Assessment", align="center")),
  
  sidebarPanel(
  
  uiOutput("chooseW"),
  dateRangeInput("daterange", label = h3("Date range"),start = "2006-01-01",end   = "2006-12-01",format = "yyyy/mm/dd", separator="-"),  
  submitButton(text="Update!")
  ) ,
  mainPanel(
  plotOutput("salesplot")
  )
  
  ) 
  )
  </code></pre>
  
  <p><strong>server.R</strong></p>
  
  <pre><code>library(shiny)
  library(ggplot2)
  library(scales) # for formatting date scales in ggplot
  
  shinyServer(function(input, output) {
  
  output$chooseW &lt;- renderUI({
  IDs&lt;- dataframe$ID
  selectInput("ID", label=h3("Choose a Worker"), IDs, 1 , multiple = TRUE)
   }) 
  
   # reactive function for plot
   data.b = reactive({
   b= subset(dataframe,Calendartime %in% (input$daterange[1]:input$daterange[2]) &amp; ID == input$ID)
    return(b)
    })
  
   output$salesplot &lt;- renderPlot({
   cc&lt;- data.b() 
   q= ggplot(cc, aes(x=Calendartime,y=salespermonth, group=ID, colour=ID)) + 
    geom_line() +scale_x_date(breaks = date_breaks("1 month"),labels = date_format("%b"))
  print(q)
  
  })   
  })
  </code></pre>