title: convert data frame to time series in R
body: <p>I have monthly data fro last two and half year. I want to convert my data frame to time series. So that I should have </p>
  
  <pre><code>Start :: 2015-01-01
  
  End :: 2017-06-01
  
  Frequency : 1
  </code></pre>
  
  <p>I have tried </p>
  
  <pre><code>ts (df [, -1], start = df [1, 1], end = df [29, 1])
  </code></pre>
  
  <p>But I get this really wired output from this.</p>
  
  <pre><code>    Time Series:
      Start = 16436 
      End = 17287 
     Frequency = 1 
  
              date inflow
     1  2015-01-01   6434
  
     2  2015-02-01   5595
  
     3  2015-03-01   3101
  
     4  2015-04-01   3475
  
     5  2015-05-01   6519
  
     6  2015-06-01   7251
  
     7  2015-07-01   4200
  
     8  2015-08-01   3622
  
     9  2015-09-01   4782
  
     10 2015-10-01   6503
  
     11 2015-11-01   9460
  
     12 2015-12-01  15623
  
     13 2016-01-01  18393
  
     14 2016-02-01  14410
  
     15 2016-03-01  11210
  
     16 2016-04-01  10582
  
     17 2016-05-01  14316
  
     18 2016-06-01  11876
  
     19 2016-07-01  13676
  
     20 2016-08-01  12466
  
     21 2016-09-01  17326
  
     22 2016-10-01  15845
  
     23 2016-11-01  15569
  
     24 2016-12-01  24933
  
     25 2017-01-01  35050
  
     26 2017-02-01  26008
  
     27 2017-03-01  25767
  
     28 2017-04-01  17858
  
     29 2017-05-01  21089
  
  
  
  dput(df)
  structure(list(date = structure(c(16436, 16467, 16495, 16526, 
  16556, 16587, 16617, 16648, 16679, 16709, 16740, 16770, 16801, 
  16832, 16861, 16892, 16922, 16953, 16983, 17014, 17045, 17075, 
  17106, 17136, 17167, 17198, 17226, 17257, 17287, 17318), class = "Date"), 
      inflow = c(6434L, 5595L, 3101L, 3475L, 6519L, 7251L, 4200L, 
      3622L, 4782L, 6503L, 9460L, 15623L, 18393L, 14410L, 11210L, 
      10582L, 14316L, 11876L, 13676L, 12466L, 17326L, 15845L, 15569L, 
      24933L, 35050L, 26008L, 25767L, 17858L, 21089L, 13570L)), row.names = c(NA, 
  -30L), class = "data.frame", .Names = c("date", "inflow"))
  </code></pre>
  
  <p>Many thanks in advance!!</p>