title: Converting ts object to data.frame
body: <p>I want to transform my <code>ts</code> object to <code>data.frame</code> object. My MWE is given below:</p>
  
  <h2>Code</h2>
  
  <pre><code>set.seed(12345)
  dat &lt;- ts(data=runif(n=10, min=50, max=100), frequency = 4, start = c(1959, 2))
  library(reshape2)
  df &lt;- data.frame(date=as.Date(index(dat)), Y = melt(dat)$value)
  </code></pre>
  
  <h2>Output</h2>
  
  <pre><code>         date        Y
  1  1975-05-14 86.04519
  2  1975-05-14 93.78866
  3  1975-05-14 88.04912
  4  1975-05-15 94.30623
  5  1975-05-15 72.82405
  6  1975-05-15 58.31859
  7  1975-05-15 66.25477
  8  1975-05-16 75.46122
  9  1975-05-16 86.38526
  10 1975-05-16 99.48685
  </code></pre>
  
  <p>I have lost my quarters in date columns. How can I figure out the problem?</p>