Skip to content
Prev 245678 / 398506 Next

Writing a single output file

This should get you close:
[1] "file1.csv" "file2.csv" "file3.csv" "file4.csv"
+     .data <- read.table(.name, header = TRUE, as.is = TRUE)
+     # add file name to the data
+     .data$file <- .name
+     .data
+ }))
date yield_rate      file
1 12/23/2010       5.25 file1.csv
2 12/22/2010       5.19 file1.csv
3 12/23/2010       5.25 file2.csv
4 12/22/2010       5.19 file2.csv
5 12/23/2010       5.25 file3.csv
6 12/22/2010       5.19 file3.csv
7 12/23/2010       5.25 file4.csv
8 12/22/2010       5.19 file4.csv
date file1.csv file2.csv file3.csv file4.csv
1 12/22/2010      5.19      5.19      5.19      5.19
2 12/23/2010      5.25      5.25      5.25      5.25

        
On Thu, Dec 23, 2010 at 8:07 AM, Amy Milano <milano_amy at yahoo.com> wrote: