title: dplyr::rename_at gives error "must evaluate to column positions or names"
body: <p>I feel like I'm missing something pretty basic, but I'm having trouble using <code>rename_at</code> with a custom renamer function:</p>
  
  
  
  <pre class="lang-r prettyprint-override"><code>library(tidyverse)
  </code></pre>
  
  <p>Say I want to swap the <code>Sepal</code> and the metric for the columns with names starting with <code>Sepal</code>. I would expect this to work, but it doesn't:</p>
  
  <pre class="lang-r prettyprint-override"><code>iris %&gt;%
    rename_at(vars(starts_with("Sepal"), funs(str_replace(., "(Sepal)\\.(.*)", "\\2\\.\\1"))))
  #&gt; Warning: 'glue::collapse' is deprecated.
  #&gt; Use 'glue_collapse' instead.
  #&gt; See help("Deprecated") and help("glue-deprecated").
  #&gt; Error: `funs(str_replace(., "(Sepal)\\.(.*)", "\\2\\.\\1"))` must evaluate to column positions or names, not a list
  </code></pre>
  
  <p>Nor does it work if I wrap the function call and don't use <code>funs()</code>:</p>
  
  <pre class="lang-r prettyprint-override"><code>sepal_renamer &lt;- function(names){
    str_replace(names, "(Sepal)\\.(.*)", "\\2\\.\\1")
  }
  iris %&gt;%
    rename_at(vars(starts_with("Sepal"), sepal_renamer))
  #&gt; Warning: 'glue::collapse' is deprecated.
  #&gt; Use 'glue_collapse' instead.
  #&gt; See help("Deprecated") and help("glue-deprecated").
  #&gt; Error: `sepal_renamer` must evaluate to column positions or names, not a function
  </code></pre>
  
  <p>I know I can just use the regex powers to get the desired result, but I don't understand why it works for <code>rename_all</code> (and even <code>colnames&lt;-()</code>) but not <code>rename_at</code>. And I'd like a solution even if making the right replacements with regex would not be possible (like trying to map some names to new names)</p>
  
  <pre class="lang-r prettyprint-override"><code>iris %&gt;% rename_all(funs(str_replace(., "(Sepal)\\.(.*)", "\\2\\.\\1"))) %&gt;% colnames
  #&gt; [1] "Length.Sepal" "Width.Sepal"  "Petal.Length" "Petal.Width" 
  #&gt; [5] "Species"
  
  iris %&gt;% `colnames&lt;-`(str_replace(colnames(.), "(Sepal)\\.(.*)", "\\2\\.\\1")) %&gt;% colnames
  #&gt; [1] "Length.Sepal" "Width.Sepal"  "Petal.Length" "Petal.Width" 
  #&gt; [5] "Species"
  </code></pre>
  
  <p>Anyone have any suggestions - am I missing some basic syntax thing? The error doesn't pop anything intuitive at me, and I am more confused because it works with <code>rename_all</code> anyway.</p>