title: Add column to Data Frame based on values of other columns
body: <p>My dataframe <code>DF</code> looks like:</p>
  
  <pre><code>ID    Name1    Name2    Group    
  1234  A1       x
  1234  A4       w
  1234  A3       q
  1234  A        A
  1234  A2       z
  5678  B3       s
  5678  B        B
  ...
  </code></pre>
  
  <p>I need to add a column for <code>Group</code> that is <code>Name1</code> for each <code>ID</code> that matches the <code>ID</code> in the row where <code>Name1 == Name2</code>.</p>
  
  <p>So the logic would be to check if Name1 == Name2, remember the ID of that Row and the Name1 value, then for every row having that ID, put the Name1 Value in each row of the Group column.</p>
  
  <p>The result should look like:</p>
  
  <pre><code>ID    Name1    Name2    Group    
  1234  A1       x        A
  1234  A4       w        A
  1234  A3       q        A
  1234  A        A        A
  1234  A2       z        A
  5678  B3       s        B
  5678  B        B        B
  ...
  </code></pre>
  
  <p>I am not sure how to do this in the dataframe though and from Many rows with different IDs. I dont want to use loops.</p>
  
  <p><code>mutate()</code> or <code>lapply()</code> maybe?</p>
  
  <p>I can see how to add the Name1 value in the Group column for the rows where Name1==Name2, but how do I roll that back up for all matching IDs?</p>