title: POSXlt and filter() in R
body: <p>I would like to use POSIXlt for date/time column in my data.frame and the filter() function to filter it. My code is below.</p>
  
  <p>I believe that I have properly converted the date data to numerical but still I get an error. </p>
  
  <p>How can I sort it out without changing POSIXlt to POSIXct?</p>
  
  <pre><code>require(dplyr)
  x &lt;- "2017-03-30"
  y &lt;- "2017-04-04"
  
  name &lt;- c("a","b","c","d")
  weight &lt;- c(2,3,1,5)
  t &lt;- c("2017-03-27 08:13:17", "2017-03-30 01:05:01", "2017-04-03 02:43:35", "2017-05-27 23:13:03")
  z &lt;- data.frame(name, weight, t)
  z$t &lt;- as.POSIXlt(z$t, tz="GMT", "%Y-%m-%d %H:%M:%S")
  str(z)
  z$t
  
  x &lt;- unclass(as.Date(x)) # integer
  str(x)
  y &lt;- unclass(as.Date(y)) # integer
  str(y)
  
  d &lt;- filter(z, between(unclass(as.Date(t)), x, y))
  
  </code></pre>
  
  <p>The error this throws:</p>
  
  <p>Error: Column <code>t</code> is a date/time and must be stored as POSIXct, not POSIXlt.</p>