title: Using `dplyr::mutate()` to create several new variables from names specified in a vector
body: <p>I want to create several new empty variables in a dataframe where I specify the variable names in a vector. This works if I only specify one variable name, but breaks with several.
  I tried some previous solutions, but they didn't seem to work in this case, e.g.:  </p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/22005419/dplyr-without-hard-coding-the-variable-names">dplyr without hard-coding the variable names</a></li>
  <li><a href="https://stackoverflow.com/questions/44147967/pass-a-vector-with-names-to-mutate-to-create-multiple-new-columns">Pass a vector with names to mutate to create multiple new columns</a>  </li>
  <li><a href="https://stackoverflow.com/questions/26003574/dplyr-mutate-use-dynamic-variable-names">dplyr - mutate: use dynamic variable names</a>  </li>
  </ul>
  
  <hr>
  
  <pre><code>library(dplyr)
  
  add_columns &lt;- function(df, columns){
      columns &lt;- quo(columns)
      mutate(df, !!columns := NA_character_)
  }
  
  columns &lt;- c("x", "y")
  iris %&gt;% 
      add_columns(columns)
  
   Error: The LHS of `:=` must be a string or a symbol
  </code></pre>
  
  <p>The desired output would be:</p>
  
  <pre><code># A tibble: 150 x 7
     Sepal.Length Sepal.Width Petal.Length Petal.Width Species x     y    
            &lt;dbl&gt;       &lt;dbl&gt;        &lt;dbl&gt;       &lt;dbl&gt; &lt;fct&gt;   &lt;chr&gt; &lt;chr&gt;
   1         5.10        3.50         1.40       0.200 setosa  NA    NA   
   2         4.90        3.00         1.40       0.200 setosa  NA    NA   
   3         4.70        3.20         1.30       0.200 setosa  NA    NA   
   4         4.60        3.10         1.50       0.200 setosa  NA    NA   
   5         5.00        3.60         1.40       0.200 setosa  NA    NA   
   6         5.40        3.90         1.70       0.400 setosa  NA    NA   
   7         4.60        3.40         1.40       0.300 setosa  NA    NA   
   8         5.00        3.40         1.50       0.200 setosa  NA    NA   
   9         4.40        2.90         1.40       0.200 setosa  NA    NA   
  10         4.90        3.10         1.50       0.100 setosa  NA    NA   
  # ... with 140 more rows
  </code></pre>
  
  <p>I wonder how can I make this work? </p>