title: Creating a three dimensional array from a data frame in R
body: <p>I have radar data in a 2D data frame with 3600 rows and 800 columns that I need to convert to a 3D array with 10 rows, 360 columns, and 800 levels. I need to split the 3600 rows into 10 groups of 360 and convert the 800 columns into the levels for the new array. So, instead of-</p>
  
  <pre><code>&gt; dim(REF)
  [1] 3600  800
  </code></pre>
  
  <p>I need to put the values into the form-</p>
  
  <pre><code>&gt; dim(ref.array)
  [1]  10 360 800
  </code></pre>
  
  <p>I know this is a pretty basic request, but I can't remember much because I haven't used R much since I took the class two years ago. Any help would be appreciated.</p>
  
  <p><strong><em>Edit to answer questions below.</em></strong></p>
  
  <p>If we take the example that @BondedDust used, we get the following-</p>
  
  <pre><code>d &lt;- as.data.frame( matrix( 1:(3*4*5), 12, 5))
  array( unlist(d), dim=c(3, 4, 5) ) 
  
  , , 1
  
        [,1] [,2] [,3] [,4]
  [1,]    1    4    7   10
  [2,]    2    5    8   11
  [3,]    3    6    9   12
  
  , , 2
  
        [,1] [,2] [,3] [,4]
  [1,]   13   16   19   22
  [2,]   14   17   20   23
  [3,]   15   18   21   24
  
  , , 3
  
        [,1] [,2] [,3] [,4]
  [1,]   25   28   31   34
  [2,]   26   29   32   35
  [3,]   27   30   33   36
  
  , , 4
  
        [,1] [,2] [,3] [,4]
  [1,]   37   40   43   46
  [2,]   38   41   44   47
  [3,]   39   42   45   48
  
  , , 5
  
           [,1] [,2] [,3] [,4]
  [1,]   49   52   55   58
  [2,]   50   53   56   59
  [3,]   51   54   57   60
  </code></pre>
  
  <p>What I'm looking for is an array organized like this-</p>
  
  <pre><code>, , 1
  
        [,1] [,2] [,3] [,4]
  [1,]    1    2    3   4
  [2,]    5    6    7   8
  [3,]    9    10   11  12
  
  , , 2
  
        [,1] [,2] [,3] [,4]
  [1,]   13   14   15   16
  [2,]   17   18   19   20
  [3,]   21   22   23   24
  
  , , 3
  
        [,1] [,2] [,3] [,4]
  [1,]   25   26   27   28
  [2,]   29   30   31   32
  [3,]   33   34   35   36
  
  , , 4
  
        [,1] [,2] [,3] [,4]
  [1,]   37   38   39   40
  [2,]   41   42   43   44
  [3,]   45   46   47   48
  
  , , 5
  
        [,1] [,2] [,3] [,4]
  [1,]   49   50   51   52
  [2,]   53   54   55   56
  [3,]   57   58   59   60
  </code></pre>