title: Aggregate and keep rows with NA
body: <p>What I want to do: arrange data by name and class, sort by year, calculate the mean of the values and keep the <code>valueMessage</code>.</p>
  
  <p>Sample data:</p>
  
  <pre><code>name &lt;- c("a", "a", "b", "b")
  class &lt;- c("c1", "c1", "c3", "c3")
  year &lt;- c("2010", "2010", "2008", "2008")
  value &lt;- c(100, 33, 100, 90)
  valueMessage &lt;-c(NA, "meh", NA, NA)
  
  df &lt;- data.frame(name, class, year, value, valueMessage)
  df 
  
  
  dat &lt;- aggregate(df$value, list(year = df$year, name = df$name, class=df$class, valueMessage=df$valueMessage), mean)
  dat &lt;- dat[with(dat, order(class, name, year)), ]
  </code></pre>
  
  <p>Returns this:</p>
  
  <pre><code>year name class valueMessage  x
  1 2010    a    c1          meh 33
  </code></pre>
  
  <p>But I would like it to keep the NA and return something like this:</p>
  
  <pre><code>year name class valueMessage  x
  1 2010    a    c1          meh, NA 66.5
  2 2008    b    c3          NA 95
  </code></pre>