title: How do I use the aggregate function to mean|count|sum up multiple columns in R?
body: <p>I have a data frame <code>Donations</code> which has the following columns:</p>
  
  <pre><code>head(Donations)
  Gender  $inYear04  $inYear05  $inYear06
  M        19000      25000      7000
  F        17000      15000      12000
  F        10000      14000      10500
  M        12000      19000      8000
  M        2000       11000      18000
  F        10500      16000      19500
  </code></pre>
  
  <p>Following is the desired output:</p>
  
  <pre><code>Gender Count Percentage_Count Total_Donation  Percentage_Donation Mean_Donation
     M    51         0.5           500000          0.38                7000
     F    49         0.5           800000          0.61                9000
  </code></pre>
  
  <p>The output column labels are derived by using operations in columns <code>$inYear04</code>,<code>$inYear05</code> and <code>$inYear06</code>.</p>
  
  <p>Is <code>aggregate()</code> the best way to proceed with?</p>
  
  <p>PS:I am new to R programming</p>