title: Simple method of counting non-NAs in column of data String
body: <p>I am trying to find a simple way of counting the non missing cases in a column of a data frame. I have used the function: </p>
  
  <pre><code>foo&lt;- function(x) { sum(!is.na(x)) }
  </code></pre>
  
  <p>and then apply it to a data frame via sapply()</p>
  
  <pre><code>stats$count &lt;- sapply(OldExaminee, foo2, simplify=T)
  </code></pre>
  
  <p>Although this is working fine, I am just in disbelieve that there isn't a simpler way of counting, i.e. something in the base set of function.</p>
  
  <p>Any ideas?</p>