title: To find number of complete cases in a data frame and make a new data frame with the number of such complete cases from each file
body: <p>I want to get the number of complete cases for a given data frame and show them in the form of a data frame with id and nobs(number of complete cases for a particular id) as columns. Till now I got the answer for id's which are single numbers like 10, 23, 45 etc but for set of numbers like c(2,3,4,5) but I am getting the sum of all the lengths of each number in a set while printing for all the numbers. So I want to know where am going wrong. Below is my code.</p>
  
  <pre><code>`complete &lt;- function(directory, id = 1:332){
  
   file_list &lt;- list.files(directory, full.names=TRUE)
  
   tmp &lt;- vector(mode = "list", length = length(file_list))
   for (i in seq_along(file_list)) {
   tmp[[i]] &lt;- read.csv(file_list[[i]])
   }
   output &lt;- do.call(rbind, tmp)
  
   complete &lt;- output[complete.cases(output),]
  
  
   d&lt;-data.frame(id,nobs=length(which(complete[,"ID"] %in% id)))
   d
    }`
  </code></pre>
  
  <p>Thanks</p>