title: does mutate work with rep function?
body: <p>I have a tibble named "confidence_table". Does anyone know why if I try to add a new column using the mutate verb this does not work?</p>
  
  <pre><code># A tibble: 12 x 3
  # Groups:   Age [2]
    Age   Condition       Prop
  &lt;fctr&gt;    &lt;fctr&gt;      &lt;dbl&gt;
     0       old      0.73993056
     1       old      0.75590278
     0       old      0.15069444
     1       old      0.13090278
     0       new      0.06388889
     1       new      0.04965278
     0       new      0.05902778
     1       new      0.05416667
     0      lure      0.23055556
     1      lure      0.23645833
     0      lure      0.13819444
     1      lure      0.12013889
  </code></pre>
  
  <p>I used this function from base r and it does work</p>
  
  <pre><code>confidence_table$Confidence &lt;- as.factor(rep(c("HC", "LC"), times = 3, each = 2))
  
  # A tibble: 12 x 4
  # Groups:   Age [2]
   Age   Condition     Prop Confidence
  &lt;fctr&gt;    &lt;fctr&gt;      &lt;dbl&gt;     &lt;fctr&gt;
    0       old      0.73993056     HC
    1       old      0.75590278     HC      
    0       old      0.15069444     LC
    1       old      0.13090278     LC
    0       new      0.06388889     HC
    1       new      0.04965278     HC
    0       new      0.05902778     LC
    1       new      0.05416667     LC
    0      lure      0.23055556     HC
    1      lure      0.23645833     HC
    0      lure      0.13819444     LC
    1      lure      0.12013889     LC
  </code></pre>
  
  <blockquote>
    <p>This is the expected output that works with base r code.
    However, if I use:</p>
  </blockquote>
  
  <pre><code>confidence_table &lt;- confidence_table %&gt;%
                      mutate(Confidence = rep(c("HC", "LC"), times = 3, each = 2))
  </code></pre>
  
  <p>it says:
  Error in mutate_impl(.data, dots) : 
    Column Confidence must be length 6 (the group size) or one, not 12</p>
  
  <p>What is wrong with it?</p>