carpenterbennet / gm-github

0 stars 1 forks source link

Cumulative data processing #4

Open justbennet opened 6 years ago

justbennet commented 6 years ago

Carpenter,

I was just looking at the GM script. Right now it looks like it reads 1952, then reads 1957, then binds them together, finally, it saves the combined result. When we get new data, we'll have to edit this file each time, either with a loop or something, and it will reread all the individual files.

Would it be better to have it collect the list of .csv files -- either from the command line or from the directory -- and then loop through them all once to create the joined set of all data present? That way we won't have to change the code for new data.

Alternately, we could change it so it takes a year (or filename) as a command line argument, reads the data, then it checks to see whether the cumulative file (gdpc.csv) exists, and if it does, reads and binds it, then saves the cumulative result.

I think it might be better to do all of this inside R, though, to save having to reload R every time.

I could try my hand at a for loop or something, if you want.