title: R - Error in summarise_impl(.data, dots) : Column `center` must be length 1 (a summary value), not 2
body: <p>I'm trying to calculate the center of each group, by running the <code>calc_center</code> function with <code>dplyr</code>'s <code>group_by_</code> and <code>summarise</code> functions. However, I received an error saying that the column must be 1 column not two. What can I do to bypass it? This is my code.</p>
  
  <pre><code>library(dplyr)
  library(car)
  
  calc_center &lt;- function(x,y){
    MASS::cov.trob(cbind(x, y)$center
  }
  
  results &lt;- data %&gt;%
    group_by(group) %&gt;%
    summarise(center=calc_center(Latitude, Longitude))
  </code></pre>
  
  <p>This is my error</p>
  
  <pre><code>Error in summarise_impl(.data, dots) : 
  </code></pre>
  
  <p>Column <code>center</code> must be length 1 (a summary value), not 2</p>