title: dplyr summarise and group_by for unique values
body: <p>Here's a representative example:</p>
  
  <pre><code>DF &lt;- as.data.frame(matrix(data = 0, nrow = 9, ncol = 3))
  colnames(DF) &lt;- c("code", "actual", "expected")
  
  DF$code &lt;- letters[rep(1:3, each = 3)]
  DF$actual &lt;- runif(9, 3,5)
  DF$expected &lt;- rep(1:3, each = 3)
  </code></pre>
  
  <p>The following crashes:</p>
  
  <pre><code>  DF %&gt;%
    group_by(code) %&gt;%
    summarise(Exp = expected)
   Error: expecting a single value
  </code></pre>
  
  <p>However, the following works:</p>
  
  <pre><code>DF %&gt;%
    group_by(code) %&gt;%
    summarise(Exp = unique(expected))
  </code></pre>
  
  <p>However, the unique value by code is just one value. Why doesn't returnign the value work? Why do I need to wrap it up in a "unique"?</p>
  
  <p>Thanks!</p>