I have an excel csv with a date/time column and a value associated with that date/time. I’m trying to write a script that will go through this format (see below), and find 1) the maximum value per day, and 2) the time on that day that the maximum occurs. Preferably R would return both values to me in a new dataframe.
The data looks something like this:
V1 V2 V3
1 5/1/2012 3:00 1
2 5/1/2012 6:00 2
3 5/1/2012 9:00 5
4 5/1/2012 12:00 3
5 5/1/2012 15:00 6
6 5/1/2012 18:00 2
7 5/1/2012 21:00 1
8 5/2/2012 0:00 2
9 5/2/2012 3:00 3
10 5/2/2012 6:00 6
11 5/2/2012 9:00 4
12 5/2/2012 12:00 6
13 5/2/2012 15:00 7
14 5/2/2012 18:00 9
15 5/2/2012 21:00 1
So the function I’m envisioning would return:
1 5/1/2012 15:00 6
2 5/2/2012 18:00 9
Any ideas?
here you go: