How do I add rows based on first string in R : <p>I have a data frame that looks something like this. </p>

<pre><code>     NAME   NUMBER
1    A      3
2    B      4
3    A      7
4    B      1
</code></pre>

<p>And I want it to look like </p>

<pre><code>     NAME   NUMBER
1    A      10
2    B      5
</code></pre>

<p>What's the easiest way to do this for a data frame with 4932 rows?</p>
