title: How to keep factor strings after dplyr summarise?
body: <p>For the following example:</p>
  
  <pre><code>library(dplyr)
  
  df &lt;- data.frame(v1 = c("a", "a", "b", "b"), v2 = c(3,3,4,4), v3 = c(11,21,31,41))
  df
  
    v1 v2 v3
  1  a  3 11
  2  a  3 21
  3  b  4 31
  4  b  4 41
  </code></pre>
  
  <p>I want to summarise v3 on v2 and keep v1, with:</p>
  
  <pre><code>df %&gt;% group_by(v2) %&gt;% summarise(v1 = first(v1), s3 = sum(v3))
  </code></pre>
  
  <p>and get:</p>
  
  <pre><code>  v2 v1 s3
  1  3  1 32
  2  4  2 72
  </code></pre>
  
  <p>but I want:</p>
  
  <pre><code>  v1 v2 s3
  1  a  3 32
  2  b  4 72
  </code></pre>
  
  <p>Any idea how I cn keep the factor strings iso id's and the same order of the columns?</p>