Re: [R] Combining many files into one

2008-11-03 Thread jim holtman
The error message might mean that you have an empty file. It is probably better to use a list for reading in the data and then combine them at the end. "try" may also catch your errors: all.dat <- lapply(list.files(mydir), function(.file){ try(read.csv(.file)) }) all.dat <- do.call(rbind, al

[R] Combining many files into one

2008-11-03 Thread t c
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 automatin