title: Issue with mutate_at and parsing variable to function - R
body: <p>this is probably a simple issue, but would appreciate some help please!</p>
  <p>I have some data:</p>
  <p>data</p>
  <pre><code>structure(list(Samid = c(&quot;AD001&quot;, &quot;AD002&quot;, &quot;AD004&quot;, &quot;AD005&quot;, 
  &quot;AD008&quot;, &quot;AD010&quot;, &quot;AD011&quot;, &quot;AD012&quot;, &quot;AD013&quot;, &quot;AD014&quot;, &quot;AD015&quot;, 
  &quot;AD016&quot;, &quot;AD017&quot;, &quot;AD018&quot;, &quot;AD019&quot;, &quot;AD020&quot;, &quot;AD021&quot;, &quot;AD022&quot;, 
  &quot;AD023&quot;, &quot;AD024&quot;, &quot;AD025&quot;, &quot;AD026&quot;, &quot;AD027&quot;, &quot;AD028&quot;), GATA3 = c(0.07850703, 
  0.07850703, 0.4477987, 0.07850703, 0.2362246, 0.44779867, 0.46578259, 
  0, 0.46578259, 0.44779867, 0.24396914, 0.46578259, 0.23622459, 
  0.24396914, 0.07850703, 0.07850703, 1.25391517, 0.82224747, 0.07850703, 
  0.07850703, 0.07850703, 0.07850703, 0.83507423, 0.07850703), 
      IL4 = c(0, 0, 0, 0, 0, 0, 0, 1.26781758, 0, 0, 0, 0, 0, 0, 
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0), IL4R = c(1.65301611, 0.14846188, 
      1.6307388, 0.14846188, 0.2073535, 0.14846188, 0.4656834, 
      1.48227697, 0.65075963, 0.17073914, 0.14846188, 0.14846188, 
      0.37809262, 0.17073914, 1.65301611, 0.14846188, 1.55269688, 
      0.14846188, 2.15320576, 0.17073914, 0.44340614, 0.17073914, 
      0, 0.44340614), IRF4 = c(0, 0, 0, 0, 0, 0, 2.83446844, 0, 
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), CD207 = c(0.80003601, 
      0.33421377, 3.4723849, 2.32021021, 0.5828276, 0.94797393, 
      0.13406957, 0.70861984, 2.25418614, 1.4883206, 2.38978722, 
      3.47193671, 0.32452279, 2.31827895, 0.80003601, 0.80003601, 
      0.50751017, 2.32021021, 3.0989443, 2.0619054, 1.05640955, 
      3.31881563, 3.37422811, 2.32021021), IL1B = c(0.20787567, 
      0, 0, 0.20787567, 0, 0.20787567, 0, 0, 0, 0.20787567, 0.20787567, 
      0, 0, 0, 0, 0, 0, 0.20787567, 0, 0.20787567, 0.20787567, 
      0.61415248, 0, 0), Clinical.diagnosis = structure(c(2L, 2L, 
      2L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 3L, 3L, 2L, 2L, 3L, 3L, 3L, 
      3L, 3L, 3L, 2L, 3L, 3L, 2L), .Label = c(&quot;irritated&quot;, &quot;negative&quot;, 
      &quot;positive&quot;), class = &quot;factor&quot;)), row.names = c(NA, -24L), class = &quot;data.frame&quot;)
  </code></pre>
  <p>I want to run a Mann-whitney U on each gene (columns 2:7) comparing with the last column <code>Clinical.Diagnosis</code>.</p>
  <p>I can do this individually:</p>
  <pre><code>wilcox.test(data$GATA3, data$Clinical.diagnosis)
  </code></pre>
  <p>However, I want to iterate through each gene. I've tried this, but I'm having an issue parsing the gene into the function:</p>
  <pre><code>data %&gt;% results=mutate_at(vars(GATA3:IL1B), ~ wilcox.test(. ~ Clinical.diagnosis))
  </code></pre>
  <p>Sadly doesn't work. I want &quot;.&quot; to refer to the contents of the each gene. Finally, when I do get the results, I'd like to append the results (which will be as a list) to the original data frame. For example have 2 columns (W = result, p-value = result).</p>
  <p>My priority is getting the test run for every gene though...</p>
  <p>Many thanks in advance for your help!</p>