title: How to combine different rows of a dataframe accessing them through the name of a factor that is in another column?
body: <p>I have a dataframe with two variables, the first variable are factors and the second are numerical. I want to sum several rows based on the name of the factor in that row.</p>
  
  <p>I want the result of the sum to be stored in the row that had a higher value at the beginning and to delete the rest of the rows that have been added. The dataframe is ordered. How could I get something like that?</p>
  
  <p>For example:</p>
  
  <pre><code>I have:                         I want:
  
  Things     Numbers             Things     Numbers
  
  Bottle       35                 Bottle       35
  Pencil       27                 Paper        32
  Paper        24                 Pencil       29
  Pen          13                 Pen          13
  Phone        10                 Phone        10
  Apple         9                 Apple        9
  Chair         7
  Bus           2
  Kitchen       1
  </code></pre>
  
  <pre><code>Paper=Paper+Chair+Kitchen
  Pencil=Pencil+bus
  </code></pre>