title: make an R function that count rows without NA in multiple files
body: <p>I wrote this R function to go through csv files read them then exclude rows with NA values and return the count of rows in each file. it only work with the last file, but I want to get the no of rows for each file. </p>
  
  <pre><code>complete &lt;- function(directory, id= 1:332) {
             file.list &lt;- list.files(directory, full.names = T)
             dat &lt;- data.farme()
             for(i in id) {
              dat &lt;- read.csv(list.files[i])
             }
             complete_rows &lt;- dat[complete.cases(dat),]
             nobs &lt;- nrows(complete_rows)
             out &lt;- data.frame(id, nobs)
             out
         }
  </code></pre>
  
  <p>when I run it and call the function: complete(directory, 25:30)
  I get:
    id  nobs
  1 25  932
  2 26  932
  3 27  932
  4 28  932
  ect... it is only returning the row count of the last file in the specified range... how can I fix that? thanks</p>