title: Counting complete cases by ID for several variables
body: <p>I'm just beginning to learn R, so my apologies if this is simpler than I think it is, but I'm really struggling to find an answer.</p>
  
  <p>What I'm attempting to do is to create a vector with a count of complete cases, by ID, for multiple variables.</p>
  
  <p>For example, in this data frame:</p>
  
  <pre><code>ID&lt;-c(1:5)
  score.1&lt;-c(1, 7, 3, 5, NA, 4, 6, 9, 11, NA)
  score.2&lt;-c(2, NA, 7, 6, NA, 5, NA, 7, 10, 1)
  sample&lt;-data.frame(ID, score.1, score.2)
  
  ID score.1 score.2
  
    1       1       2
    2       7      NA
    3       3       7
    4       5       6
    5      NA      NA
    1       4       5
    2       6      NA
    3       9       7
    4      11      10
    5      NA       1
  </code></pre>
  
  <p>The output I'm looking for is something like:</p>
  
  <pre><code>ID Complete
  1    4
  2    2
  3    4
  4    4
  5    1
  </code></pre>
  
  <p>Is there a way to do this that I'm missing? I've tried count(complete.cases(sample)) with plyr and sum(complete.cases()), but it's not giving me what I actually want.</p>
  
  <p>Any help with this is appreciated.</p>