title: Merge Rows within Data Frame
body: <p>I have a relational dataset, where I'm looking for dyadic information.</p>
  
  <p>I have 4 columns. Sender, Receiver, Attribute, Edge</p>
  
  <p>I'm looking to take the repeated Sender -- Receiver counts and convert them as additional edges.</p>
  
  <pre><code>df &lt;- data.frame(sender = c(1,1,1,1,3,5), receiver = c(1,2,2,2,4,5), 
                  attribute = c(12,12,12,12,13,13), edge = c(0,1,1,1,1,0))
  
     sender receiver attribute edge
  1       1        1        12    0
  2       1        2        12    1
  3       1        2        12    1
  4       1        2        12    1
  5       3        4        13    1
  </code></pre>
  
  <p>I want the end result to look like this:</p>
  
  <pre><code>  sender receiver attribute edge
  1      1        1        12    0
  2      1        2        12    3
  3      3        4        13    1
  </code></pre>
  
  <p>Where the relationship between duplicate sender-receivers have been combined and the number of duplicates incorporated in the number of edges.</p>
  
  <p>Any input would be really appreciated.</p>
  
  <p>Thanks!</p>