title: R: how to do colMeans on a List of matrix
body: <p>I would like to know how to do colMeans on a List of matrix.</p>
  
  <p>Please show to how to do this in R.</p>
  
  <p>Thanks a lot.</p>
  
  <p>Here is my dataset looks like:</p>
  
  <pre><code>&gt; dataset
       [,1]     [,2]    
  [1,] 22.04031 28.03182
  [2,] 23.94481 28.17275
  [3,] 16.39071 25.44523
  [4,] 22.10198 22.45534
  [5,] 24.95194 27.95778
  [6,] 33.09007 36.74856
  </code></pre>
  
  <p>My desired result after colMeans will be do the mean on both col [,1] and [,2]. The mean for these two columns will be 23.75330 and 28.13524, respectively. </p>
  
  <p>Here is other information about this dataset:</p>
  
  <pre><code>&gt; str(dataset)
  List of 12
   $ : num 22
   $ : num 23.9
   $ : num 16.4
   $ : num 22.1
   $ : num 25
   $ : num 33.1
   $ : num 28
   $ : num 28.2
   $ : num 25.4
   $ : num 22.5
   $ : num 28
   $ : num 36.7
   - attr(*, "dim")= int [1:2] 6 2
  </code></pre>
  
  <p>Melting down the dataset. The column value is what I want for colMeans.</p>
  
  <pre><code>&gt; melt(dataset)
     Var1 Var2    value       NA
  1     1    1 22.04031 28.03182
  2     2    1 23.94481 28.17275
  3     3    1 16.39071 25.44523
  4     4    1 22.10198 22.45534
  5     5    1 24.95194 27.95778
  6     6    1 33.09007 36.74856
  7     1    2 22.04031 28.03182
  8     2    2 23.94481 28.17275
  9     3    2 16.39071 25.44523
  10    4    2 22.10198 22.45534
  11    5    2 24.95194 27.95778
  12    6    2 33.09007 36.74856
  </code></pre>