Suppose I have a number of csv files that have the following format:
Date,col1,col2,col3
8/1/2017,2,3,4
8/5/2017,4,6,7
Date,col1,col2,col3
8/1/2017,2,3,4
8/3/2017,2,5,4
8/5/2017,4,6,7
How would I create a 1 zoo object that for each date shows me a total for each column?
Using the file contents above I would like to create the following zoo object:
Date | col1 | col2 | col3
8/1/2017 4 6 8
8/3/2017 2 5 4
8/5/2017 8 12 14
NOTE: I would prefer a base-R solution (using zoo package is OK)