title: From dataframe to array, by row
body: <p>I have a dataframe "df", and I would like to transform it into an array BY ROW, for example:</p>
  
  <pre><code>&gt; df
      x  y
  1   1 21
  2   2 22
  3   3 23
  4   4 24
  5   5 25
  6   6 26
  7   7 27
  8   8 28
  
  #Into this array:
  
  &gt; array.df
   , , 1
  
       [,1] [,2] [,3] [,4]
  [1,]   1   21   2   22
  [2,]   3   23   4   24
  
  , , 2
  
       [,1] [,2] [,3] [,4]
  [1,]   5   25   6   26
  [2,]   7   27   8   28
  </code></pre>
  
  <p>Can anyone help me with the code? Thanks.</p>