title: Moving from zoo to xts object
body: <p>I have various financial data that I am trying to merge into an <code>xts</code> object so I can perform multiple statistical analyses.  I am having difficulty, however, with dates when moving from the original data to a <code>zoo</code> object to an <code>xts</code> object.</p>
  
  <p>For instance, I read in some hedge fund return data, change the report date variable using the <code>ymd</code> function from the <code>lubridate</code> package, create a <code>zoo</code> object, then just as a check create a timeSeries object. All seems to be OK, but I continue to get an error when I attempt to create the <code>xts</code> object, as shown below:</p>
  
  <pre><code>hfIndexes$ReportDt &lt;- ymd(hfIndexes$ReportDt)
  hfIndexesZoo &lt;- zoo(hfIndexes,order.by="ReportDt")
  hfIndexesTimeSeries &lt;- as.timeSeries(hfIndexesZoo)
  hfIndexesXTS &lt;- as.xts(hfIndexesZoo)
  Error in xts(coredata(x), order.by = order.by, frequency = frequency,  : 
    order.by requires an appropriate time-based object
  </code></pre>
  
  <p>What do I need to do to ensure that I have the correct time-based object to create the desired <code>xts</code> object?</p>