title: how to perform sum and count on dataframe in R
body: <p>I have a dataframe with ID, type, and the area I would like to perform two operations at once </p>
  
  <pre><code>ID         Type         Area     
  1           Aa          0.02    
  2           Ag          0.12    
  2           Ag          0.14    
  2           Ag          0.80    
  2           Bm          0.20    
  2           Xm          0.13    
  </code></pre>
  
  <p>The expected outcome is </p>
  
  <pre><code>ID          Type       count      area     
  1           Aa           1        0.02    
  2           Ag           3        1.06 (sum)    
  2           Bm           1        0.20    
  2           Xm           1        0.13 
  </code></pre>
  
  <p>I have up to 100-150 ID and type, count and basal area varies for each type with the same ID, what would be the best approach to perform sum and count same time and keep type and ID  in dataframe? </p>
  
  <p>Thanks</p>