title: Flattening 3-Dimensional data to elongated 2-D in R
body: <p>I have data with dim 10,5,2 (t,x,y) and I want to convert it to dimensions 10*5,3. i.e to append every t frame to (x,y) frame with t value.</p>
  
  <p>eg:</p>
  
  <pre><code>data[1,,]=
  x y
  1 2
  1 3
  
  data[2,,]=
  x y
  5 2
  1 6
  </code></pre>
  
  <p>I would like to convert this data to flatten array like this</p>
  
  <pre><code>x y t
  1 2 1
  1 3 1
  5 2 2
  1 6 2
  </code></pre>
  
  <p>I was looking if there is already R function to do this or I'd do it by looping every t array and add the recreated array at bottom of main array.</p>