R max value over a series of days
I'm trying to use R to find the max value of each day for 1 to n days. My
issue is there are multiple values in each day. Heres my code. After I run
it it shows same answer for each day:
20130311 12
20130311 12
Any suggestions: trying:
library(plyr)
ddply(theData,.(theData$Date),summarize,max.value=max(Data$Value))
theData$Date theData$Time theData$Value
20130310 09:30:00 5
20130310 09:31:00 1
20130310 09:32:00 2
20130310 09:33:00 3
20130311 09:30:00 0
20130311 09:31:00 12
20130311 09:32:00 1
20130311 09:33:00 5
so this should return:
day time value
20130310 09:30:00 5
20130311 09:31:00 12
Any suggestions?
No comments:
Post a Comment