title: Concatenating two text columns in dplyr
body: <p>My data looks like this:</p>
  <pre><code>round &lt;- c(rep(&quot;A&quot;, 3), rep(&quot;B&quot;, 3))
  experiment &lt;- rep(c(&quot;V1&quot;, &quot;V2&quot;, &quot;V3&quot;), 2)
  results &lt;- rnorm(mean = 10, n = 6)
  
  df &lt;- data.frame(round, experiment, results)
  
  &gt; df
    round experiment   results
  1     A         V1  9.782025
  2     A         V2  8.973996
  3     A         V3  9.271109
  4     B         V1  9.374961
  5     B         V2  8.313307
  6     B         V3 10.837787
  </code></pre>
  <p>I have a different dataset that will be merged with this one where each combo of <code>round</code> and <code>experiment</code> is a unique row value, ie, <code>&quot;A_V1&quot;</code>. So what I really want is a variable <code>name</code> that concatenates the two columns together. However, this is tougher to do in dplyr than I expected. I tried:</p>
  <pre><code>name_mix &lt;- paste0(df$round, &quot;_&quot;, df$experiment)
  new_df &lt;- df %&gt;%
    mutate(name = name_mix) %&gt;%
    select(name, results)
  </code></pre>
  <p>But I got the error, <code>Column name must be length 1 (the group size), not 6</code>. I also tried the simple base-R approach of <code>cbind(df, name_mix)</code> but received a similar error telling me that <code>df</code> and <code>name_mix</code> were of different sizes. What am I doing wrong?</p>