title: R sum a variable by two groups
body: <p>I have a data frame in R that generally takes this form:</p>
  
  <pre><code>ID     Year     Amount  
  3       2000      45  
  3       2000      55  
  3       2002      10  
  3       2002      10  
  3       2004      30  
  4       2000      25  
  4       2002      40  
  4       2002      15  
  4       2004      45  
  4       2004      50
  </code></pre>
  
  <p>I want to sum the Amount by ID for each year, and get a new data frame with this output.</p>
  
  <pre><code>ID      Year     Amount  
  3       2000      100  
  3       2002       20  
  3       2004       30  
  4       2000       25  
  4       2002       55  
  4       2004       95 
  </code></pre>
  
  <p>This is an example of what I need to do, in reality the data is much larger. Please help, thank you!</p>