title: Apply a bunch of functions to columns of a matrix in R
body: <p>There is a way to apply a function <code>f</code> to every column of a matrix:</p>
  
  <pre><code>M &lt;- matrix(seq(1,16), 4, 4)
  apply(M, 2, mean)
  #[1]  2.5  6.5 10.5 14.5
  </code></pre>
  
  <p>But if I want to build a descriptive statistics about matrix I should use more indeces. For example, <code>max, min, mean</code> etc.</p>
  
  <p>But R doesn't allow to do something like this:</p>
  
  <pre><code>apply(M, 2, c(mean, max))
  </code></pre>
  
  <p>to get this output:</p>
  
  <pre><code>#      [,1] [,2] [,3] [,4]
  #mean   2.5  6.5 10.5 14.5
  #max      4    8   12   16
  </code></pre>
  
  <p>Would you tell me how to manage with this problem?</p>