title: R time_trans works with objects of class POSIXct
body: <p>I have data with stock prices(data). Stock data I would like to visualize it. I first use ggplot R plotting to visualize the series. </p>
  
  <pre><code>    Date      Closed
  2010-07-19    0.0808
  2010-07-20    0.7547
  </code></pre>
  
  <p>When I used below code</p>
  
  <pre><code>    my_date_format &lt;- function()
  {
    function(x)
    {
      m &lt;- format(x,"%b")
      y &lt;- format(x,"%Y")
      ifelse(duplicated(y),m,paste(m,y))
    }
  }
  
  ggplot(data, aes(x=Date, z=Closed)) +
    geom_point() +
    scale_x_datetime(breaks = date_breaks("1 month"), labels=my_date_format())
  </code></pre>
  
  <p>I had an error: Error: Invalid input: time_trans works with objects of class POSIXct only</p>
  
  <p>Of course I tried to change Date as a Date format, but it didn't work too.
  I also tried</p>
  
  <pre><code>    ggplot(data, aes(Date, Closed)) + geom_line() +
    scale_x_date(format = "%Y-%m-%d") + xlab("") + ylab("Closed")
  
  or
  
  ggplot(data,aes(Date,Closed))+geom_line() + scale_x_date(breaks = “1 month”,labels=date_format(“%b/%y”)) +xlab(” “) + ylab(“closed”)
  </code></pre>
  
  <p>but it doesn't work too.
  My desired output looks similary like this
  <a href="https://i.stack.imgur.com/oeQur.png" rel="noreferrer"><img src="https://i.stack.imgur.com/oeQur.png" alt="enter image description here"></a></p>