title: R group by, counting non-NA values
body: <p>I have a dataframe that has a scattering of NA's </p>
  
  <pre><code>toy_df
  # Y  X1 X2 Label
  # 5  3  3  A
  # 3  NA 2  B
  # 3  NA NA C
  # 2  NA 6  B
  </code></pre>
  
  <p>I want to group this by the label field, and count how many non NA values are in each variable for each label.</p>
  
  <pre><code>desired output:
  # Label Y  X1 X2
  # A     1  1  1
  # B     2  0  2
  # C     1  0  0
  </code></pre>
  
  <p>I've done this using loops at the moment, but it's slow and untidy and I'm sure there's a better way. </p>
  
  <p>Aggregate seems to get half way there, but it includes NA's in the count.</p>
  
  <pre><code>aggregate(toy_df, list(toy_df$label), FUN=length)
  </code></pre>
  
  <p>Any ideas appreciated...</p>