title: Invalid input: date_trans works with objects of class Date only
body: <p>Implementing this with ggplot2 and shiny by having two input selections for the date ranges and have the plot adjust the x(date values) adjust accordingly, however, I get this error below:</p>
  
  <pre><code>Invalid input: date_trans works with objects of class Date only
  </code></pre>
  
  <p>How can I resolve this? Here is my code below:</p>
  
  <pre><code>library(shiny)
  library(ggplot2)
  library(dplyr)
  
  
  
  data &lt;- read.csv("C:/Users/user/Documents/R/R-3.3.1/R CODE/MyData2.csv", header = TRUE) # reading .csv
  newdata &lt;- as.data.frame(data) # converting csv to DF
  newdata$event_date &lt;- as.factor(newdata$event_date)
  
  str(newdata)
  
  ui &lt;- fluidPage(
  
    selectInput("select", label = h3("Select Model"), 
                choices = list("Toyota Camry", "Nissan Altima")),
  
    dateInput("strtdate", "Select start date:"),
  
    dateInput("enddate", "Select end date:"),
  
    plotOutput("hist")
  )
  
  server &lt;- function(input, output) {
  
    output$hist &lt;- renderPlot({
  
      df &lt;- newdata %&gt;% select(event_date,PlatformName,total_events) %&gt;% filter(PlatformName == input$select) %&gt;% group_by(event_date, PlatformName) %&gt;% summarize(total_events = sum(total_events))
  
      gg &lt;- ggplot(df, aes(x= event_date, y = total_events, group =PlatformName)) +
        geom_line(aes(color = PlatformName)) +
  
  
        labs(title="Total Events vs. Time", x="Event Dates", y="Total Events") +
  
                  aes(xmin = input$strtdate, 
                      xmax = input$enddate) +
  
  
        theme(plot.title=element_text(size=20, face="bold", hjust = 0.5),
              axis.text.x=element_text(size=10, angle=90,hjust=1,vjust=0.5),
              axis.text.y=element_text(size=5),
              axis.title.x=element_text(size=10),
              axis.title.y=element_text(size=10)) 
  
      print(gg)
  
    })
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>