[R] Read all the 332 files and count the number of complete rows
Baba s
sairamhello0328 at gmail.com
Thu Jan 28 02:41:37 CET 2016
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]]
More information about the R-help
mailing list