title: Difference between "as.numeric" and "as.POSIXct.numeric" (only the first seems to work)?
body: <p>I am struggling with <code>as.POSIXct.numeric</code>. The following code works:</p>
  <pre><code>dates &lt;- structure(c(1649285787, 1651134684), class = c(&quot;POSIXct&quot;, &quot;POSIXt&quot;), 
                     tzone = &quot;UTC&quot;)
  lims &lt;- as.numeric(dates)
  limits &lt;- as.POSIXct.numeric(lims, origin = as.POSIXct(&quot;1970-01-01&quot;, tz = &quot;UTC&quot;))
  plot(stepfun(x = dates, # OK
               y = c(0, 1, 2)),
       do.points = FALSE)
  plot(stepfun(x = dates, # OK 
               y = c(0, 1, 2)),
       do.points = FALSE, 
       xlim = lims)
  </code></pre>
  <p>However, the following fails and I don't understand why (I need to specify the limits):</p>
  <pre><code>plot(stepfun(x = dates, # Not OK
               y = c(0, 1, 2)),
       do.points = FALSE, 
       xlim = dates)
  # Error in as.POSIXct.numeric(e) : 'origin' must be supplied
  plot(stepfun(x = dates, # Not OK
               y = c(0, 1, 2)),
       do.points = FALSE, 
       xlim = limits)
  # Error in as.POSIXct.numeric(e) : 'origin' must be supplied
  </code></pre>
  <p>Does anybody understand this behavior? I explicitly specified the origin in <code>as.POSIXct.numeric(lims, origin = ...)</code>!</p>