title: Mean and standard deviation by groups
body: <p>I have a data frame something like this:</p>
  
  <pre><code>obs1 obs2 obs3 obs4 obs5
  4     6    7     3    0
  7     2    4     5    0
  2     5    7     8    1
  5     8    6     9    1
  6     0    3     6    1
  7     1    2     4    1
  </code></pre>
  
  <p>I want to compute the mean and standard deviation for obs 1 to 4 conditioned on obs5 and put it in a table format. The columns headings should be means and standard deviation for each of whether the obs5 is "0" or "1". Thus in this case the table will be of 4 by 4 type.</p>
  
  <p>I tried </p>
  
  <pre><code>table &lt;- aggregate( .~ obs5, DF, function(x) c(mean = mean(x), sd = sd(x)))
  </code></pre>
  
  <p>and am not sure what to do further to get proper format.</p>