title: Converting a Data Frame into a Time Series in R
body: <p>I have a weird problem with converting a data frame into a time series:</p>
  
  <p>1) I have a data frame which has 420,000 rows. It looks like:</p>
  
  <pre><code> &gt; numsdf[5760:5764,]
  
                YR--MODAHRMN TEMP DEWP
   7712 1973-04-29 00:00:00   82   35
   7713 1973-04-29 01:00:00   78   41
   7714 1973-04-29 02:00:00   73   45
   7715 1973-04-29 03:00:00   66   41
   7716 1973-04-29 04:00:00   61   46
  </code></pre>
  
  <p>2) I convert this into a time series. No problem up to here.</p>
  
  <pre><code>&gt; tsdf=with(numsdf, xts(numsdf$TEMP, order.by = numsdf$"YR--MODAHRMN"))
  </code></pre>
  
  <p>3) Problem 1: For some reason the TEMP column becomes V1. No idea why.</p>
  
  <pre><code> &gt; tsdf[5760:5764,]
                        [,1]
   1973-04-29 00:00:00   82
   1973-04-29 01:00:00   78
   &lt;NA&gt;                  73
   1973-04-29 03:00:00   66
   1973-04-29 04:00:00   61
  </code></pre>
  
  <p>3) Problem 2: </p>
  
  <p>Some dates, (randomly and for no apparent reason) are changed to . As in the example above, I don't know why this happens. Thanks</p>