title: Shiny Reactive ggplot Output
body: <p>I have the following code that I am unsuccessfully trying to run.  I just want to be able to filter a graph output based on an input range.  In this example, if the range input is set to 1-5, I would like to see 5 points on the graph, likewise range input of 2-5 shows 4 points.</p>
  
  <pre><code>##UI   
  require(shiny)
  shinyUI(fluidPage(
  titlePanel(title=h4("Races", align="center")     
  ),
  sidebarPanel( 
  sliderInput("num", "Number:",
              min = 0, max = 5,step=1,value=c(0,2)),
  mainPanel(
    plotOutput("plot2")))))
  
  ##server
  library(dplyr)
  library(ggplot2)
  shinyServer(function(input,output){
  num&lt;-c(1,2,3,4,5)
  let&lt;-c("A","B","C","D","E")
  date&lt;-c("2015-5-1","2015-6-1","2015-7-1","2015-8-1","2015-9-1")
  df&lt;-data.frame(num,let,date)
  dat&lt;-reactive({
  df %&gt;% filter(num==input$num)})
  output$plot2&lt;-renderPlot({
  ggplot(dat(),aes(x=date,y=num))+geom_point(colour='red')},height = 400,
  width = 600)})
  </code></pre>
  
  <p>I would like to show the range of values on the graph based on the input range but only 1 value is showing, not the range of values with corresponding dates.</p>
  
  <p>Thanks in advance.</p>