title: Any way to specify different NA actions for different functions in summaryBy?
body: <p>Is there a way to specify different NA actions for different functions in summaryBy? For example, say I want the mean and the number of observations for various groups in a data set. I can do this:</p>
  
  <pre><code>library(doBy)
  var1 = c(10.5,15,6.2,3.5,NA,NA)
  group = c("A","B","B","A","B","A")
  df = data.frame(var1, group)
  summaryBy(var1 ~ group, data=df, FUN=c(mean,length), na.rm=TRUE)
  </code></pre>
  
  <p>You need the <code>na.rm = TRUE</code> so that the <code>mean</code> function will work with missing values. However, the <code>length</code> function takes only one argument, yet <code>summaryBy</code> passes <code>na.rm=TRUE</code> to <code>length</code> as wells as to <code>mean</code>, so the <code>summaryBy</code> call gives the following error:</p>
  
  <pre><code>Error in currFUN(x, ...) : 
  2 arguments passed to 'length' which requires 1
  </code></pre>
  
  <p>Is there some way to specify within <code>summaryBy</code> that the <code>na.rm=TRUE</code> argument should be passed only to <code>mean</code> and not to <code>length</code>? Or is there some other (reasonably elegant) workaround?</p>