title: having trouble using stack function-R
body: <p>I have to below data frame(df):</p>
  <pre><code>&gt; df
              a           b           c           d           e
  1 0.007706719 0.007706719 0.007706719 0.007706719 0.007706719
  2 0.007247824 0.007706719 0.007706719 0.007706719 0.007706719
  3 0.006716007 0.007026198 0.007706719 0.007545972 0.007449816
  4 0.008652269 0.009386124 0.010247610 0.009349975 0.009236069
  5 0.011559262 0.011755480 0.011594489 0.012190477 0.012029822
  </code></pre>
  <p>With dput form:</p>
  <pre><code>&gt; dput(df)
  structure(list(a = structure(c(0.00770671877718716, 0.00724782403499172, 
  0.00671600662378172, 0.00865226924460998, 0.0115592617816976), class = c(&quot;xts&quot;, 
  &quot;zoo&quot;), index = structure(c(86400, 172800, 259200, 345600, 432000
  ), tzone = &quot;&quot;, tclass = c(&quot;POSIXct&quot;, &quot;POSIXt&quot;)), .Dim = c(5L, 
  1L)), b = structure(c(0.00770671877718716, 0.00770671877718716, 
  0.00702619830053687, 0.00938612381100274, 0.0117554804029797), class = c(&quot;xts&quot;, 
  &quot;zoo&quot;), index = structure(c(86400, 172800, 259200, 345600, 432000
  ), tzone = &quot;&quot;, tclass = c(&quot;POSIXct&quot;, &quot;POSIXt&quot;)), .Dim = c(5L, 
  1L)), c = structure(c(0.00770671877718716, 0.00770671877718716, 
  0.00770671877718716, 0.0102476100939602, 0.011594488602641), class = c(&quot;xts&quot;, 
  &quot;zoo&quot;), index = structure(c(86400, 172800, 259200, 345600, 432000
  ), tzone = &quot;&quot;, tclass = c(&quot;POSIXct&quot;, &quot;POSIXt&quot;)), .Dim = c(5L, 
  1L)), d = structure(c(0.00770671877718716, 0.00770671877718716, 
  0.00754597153109664, 0.00934997518422475, 0.0121904772376695), class = c(&quot;xts&quot;, 
  &quot;zoo&quot;), index = structure(c(86400, 172800, 259200, 345600, 432000
  ), tzone = &quot;&quot;, tclass = c(&quot;POSIXct&quot;, &quot;POSIXt&quot;)), .Dim = c(5L, 
  1L)), e = structure(c(0.00770671877718716, 0.00770671877718716, 
  0.00744981620477373, 0.00923606895843253, 0.0120298215459641), class = c(&quot;xts&quot;, 
  &quot;zoo&quot;), index = structure(c(86400, 172800, 259200, 345600, 432000
  ), tzone = &quot;&quot;, tclass = c(&quot;POSIXct&quot;, &quot;POSIXt&quot;)), .Dim = c(5L, 
  1L))), row.names = c(NA, 5L), class = &quot;data.frame&quot;)
  &gt; stack(df)
  </code></pre>
  <p>I want to reshape df using stack function(column headers to rows). But I get the below error:</p>
  <pre><code>&gt; stack(df)
  Error in stack.data.frame(df) : no vector columns were selected
  </code></pre>
  <p>I want to reshape as below:</p>
  <pre><code>a 0.007706719 
  a 0.007247824 
  a 0.006716007 
  a 0.008652269 
  a 0.011559262 
  b 0.007706719 
  b 0.007706719 
  b 0.007026198 
  b 0.009386124 
  b 0.011755480 
  c 0.007706719 
  c 0.007706719 
  c 0.007706719 
  c 0.010247610 
  c 0.011594489 
  d 0.007706719 
  d 0.007706719
  d 0.007545972
  d 0.009349975
  d 0.012190477
  e 0.007706719
  e 0.007706719
  e 0.007449816
  e 0.009236069
  e 0.012029822
  </code></pre>
  <p>How can I solve the problem? Thanks a lot.</p>