title: Error in a r function based on a dataset information
body: <p>I have this dataset:</p>
  <pre><code>df &lt;- data.frame( raca = c(&quot;Nel&quot;,&quot;Nel&quot;,&quot;Nel&quot;, &quot;Nel&quot;,&quot;Angus&quot;,&quot;Angus&quot;,&quot;Angus&quot;,&quot;Angus&quot;),
                    marmo = c(350, 320, 330, 400, 800, 820, 450, NA))
  </code></pre>
  <p>and I would like to do the descriptive statistics. I used this code:</p>
  <pre><code>df %&gt;%
    group_by(raca) %&gt;%
    dplyr::summarise(across(1,~data.frame(Média =round(mean(.,na.rm=TRUE,digits=2),digits = 2),
                                                      N = length(.),
                                                      DP = round(sd(.,na.rm=TRUE),digits = 2),
                                                      Min = min(.,na.rm=TRUE),
                                                      Max = max(.,na.rm=TRUE),
                                                      `Coef Variação` = round(sd(., na.rm=TRUE)/mean(.,na.rm=TRUE)*100,digits=2)))) %&gt;%
    pivot_longer(-raca) %&gt;% arrange(name,raca)
  </code></pre>
  <p>and worked well. But I would like to a function, and I tried this code:</p>
  <pre><code>desc_function &lt;- function(a,b, c)   { a %&gt;%
      group_by(a[,b]) %&gt;%
      dplyr::summarise(across(a[,c],~data.frame(Média =round(mean(.,na.rm=TRUE,digits=2),digits = 2),
                                                N = length(.),
                                                DP = round(sd(.,na.rm=TRUE),digits = 2),
                                                Min = min(.,na.rm=TRUE),
                                                Max = max(.,na.rm=TRUE),
                                                `Coef Variação` = round(sd(., na.rm=TRUE)/mean(.,na.rm=TRUE)*100,digits=2)))) %&gt;%
      pivot_longer(a[,b]) %&gt;% arrange(name,a[,b])}
  
  
  desc_function(df, &quot;raca&quot;, &quot;marmo&quot;)
  </code></pre>
  <p>But this error happened:</p>
  <pre><code> Error: Problem with summarise() input ..1.
  i ..1 = across(...).
  x Selections can't have missing values.
  i The error occurred in group 1: a[, b] = &quot;Angus&quot;.
  Run rlang::last_error() to see where the error occurred.
  </code></pre>