I have a few hundred .csv files in a folder on my hard drive, and I would like 
to combine them all into one file.  They are all the same data, but the program 
that collected the data saved a file every 4 hours.  I can combine the files 
one at a time using rbind, but am having a problem automating it in a for 
loop.  The loop runs for a while, and finally gives an error message "no lines 
available in input".  I would appreciate any help you can give.  What I have so 
far is below.  Thanks!  Tim
 
 
files<-list.files(mydir)                               #List of every file in 
the working directory
 
for (i in 1:length(files))                             #Loops through files
 {
 dat <- read.csv(files[i], header=T)          #Reads one file at a time
 all.dat<-rbind(dat)                                  #Binds the file just read 
to the end of all.dat
 }



      
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
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