title: Dplyr or Magrittr - tolower?
body: <p>Is it possible to set all column names to upper or lower within a dplyr or magrittr chain?</p>
  
  <p>In the example below I load the data and then, using a magrittr pipe, chain it through to my dplyr mutations. In the 4th line I use the <code>tolower</code> function , but this is for a different purpose: to create a new variable with lowercase observations. </p>
  
  <pre><code>mydata &lt;- read.csv('myfile.csv') %&gt;%
      mutate(Year = mdy_hms(DATE),
             Reference = (REFNUM),
             Event = tolower(EVENT)
  </code></pre>
  
  <p>I'm obviously looking for something like <code>colnames = tolower</code> but know this doesn't work/exist.</p>
  
  <p>I note the dplyr <code>rename</code> function but this isn't really helpful. </p>
  
  <p>In magrittr the colname options are:</p>
  
  <p><code>set_colnames</code> instead of base R's <code>colnames&lt;-</code><br>
  <code>set_names</code> instead of base R's <code>names&lt;-</code></p>
  
  <p>I've tried numerous permutations with these but no dice. </p>
  
  <p>Obviously this is very simple in base r. </p>
  
  <pre><code>names(mydata) &lt;- tolower(names(mydata))
  </code></pre>
  
  <p>However it seems incongruous with the <a href="/questions/tagged/dplyr" class="post-tag" title="show questions tagged &#39;dplyr&#39;" rel="tag">dplyr</a>/<a href="/questions/tagged/magrittr" class="post-tag" title="show questions tagged &#39;magrittr&#39;" rel="tag">magrittr</a> philosophies that you'd have to do that as a clunky one liner, before moving on to an elegant chain of dplyr/magrittr code. </p>