title: how to calculate mean/median per group in a dataframe in r
body: <p>I have a dataframe recording how much money a costomer spend in detail like the following:</p>
  
  <pre><code>custid, value
  1,  1
  1,  3
  1,  2
  1,  5
  1,  4
  1,  1
  2,  1
  2,  10
  3,  1
  3,  2
  3,  5
  </code></pre>
  
  <p>How to calcuate the charicteristics using mean,max,median,std, etc like the following? Use some apply function? And how?</p>
  
  <pre><code>custid, mean, max,min,median,std
  1,  ....
  2,....
  3,....
  </code></pre>