Hi,

I want this function to read all the 332 files and count the number of
complete rows
in the data. When I run this function, I am getting only the last one.
It should give me id and rowcount for 332 files in one vector.

What am I doing wrong in this code?

 complete<-function(id=1:332){
  all_files<-list.files()
  for (i in id){
  ncases<-nrow(na.omit(read.csv(all_files[i])))
  idcase<-cbind(id,ncases)}
}

Regards,
Sai.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to