title: Use dynamic name for new column/variable in `dplyr`
body: <p>I want to use <code>dplyr::mutate()</code> to create multiple new columns in a data frame. The column names and their contents should be dynamically generated.</p>
  <p>Example data from iris:</p>
  <pre><code>library(dplyr)
  iris &lt;- as_tibble(iris)
  </code></pre>
  <p>I've created a function to mutate my new columns from the <code>Petal.Width</code> variable:</p>
  <pre><code>multipetal &lt;- function(df, n) {
      varname &lt;- paste(&quot;petal&quot;, n , sep=&quot;.&quot;)
      df &lt;- mutate(df, varname = Petal.Width * n)  ## problem arises here
      df
  }
  </code></pre>
  <p>Now I create a loop to build my columns:</p>
  <pre><code>for(i in 2:5) {
      iris &lt;- multipetal(df=iris, n=i)
  }
  </code></pre>
  <p>However, since mutate thinks varname is a literal variable name, the loop only creates one new variable (called varname) instead of four (called petal.2 - petal.5).</p>
  <p>How can I get <code>mutate()</code> to use my dynamic name as variable name?</p>