I’m trying to write an R script that will go through a dataframe that i import from an excel spreadsheet (see below for format), and find the sum of daily values until the daily maxima (and including the daily maxima)
The data looks something like this:
5/1/2012 0:00 0
5/1/2012 3:00 1
5/1/2012 6:00 2
5/1/2012 9:00 5
5/1/2012 12:00 3
5/1/2012 15:00 6
5/1/2012 18:00 2
5/1/2012 21:00 1
5/2/2012 0:00 2
5/2/2012 3:00 3
5/2/2012 6:00 6
5/2/2012 9:00 4
5/2/2012 12:00 6
5/2/2012 15:00 7
5/2/2012 18:00 9
5/2/2012 21:00 1
So the function I’m envisioning would return:
1 5/1/2012 15:00 17
2 5/2/2012 18:00 35
Any ideas?
Here is a very minor tweak to an answer given by @Thierry in your last question
I would say also that you havent shown any initiative or any work.
EDIT @John yes the OP changed the data slightly since last question have edited to reflect this.