title: Dplyr Grouped Mutate Do alternative?
body: <p>I have a series of accounts with unique account numbers that can be grouped by a sequence number. I would like to use the unique account number at the beginning of each sequence as a new reference column for the entire group. I can accomplish my task with <code>Do</code> however I think my solution is pretty inelegant. Using this example code, could someone demonstrate a cleaner way to achieve the output? </p>
  
  <pre><code>library(tidyverse)
  
  df &lt;- tibble(Seq = factor(c(1,1,1,2,2,2,2,3,3)),
           Num = c("8432", "a2233", "234", 
                   "b532", "q265", "z4453", "1232", 
                   "a644", "124"))
  
  df %&gt;% 
     group_by(Seq) %&gt;%
     do(mutate(.,HH = as_vector(.[1,2]))) %&gt;%
     ungroup()
  </code></pre>
  
  <p>Output:   </p>
  
  <pre><code>    # A tibble: 9 × 3
       Seq   Num    HH
    &lt;fctr&gt; &lt;chr&gt; &lt;chr&gt;
  1      1  8432  8432
  2      1 a2233  8432
  3      1   234  8432
  4      2  b532  b532
  5      2  q265  b532
  6      2 z4453  b532
  7      2  1232  b532
  8      3  a644  a644
  9      3   124  a644
  </code></pre>