I have a data file that needs to averaged.
data<-data.frame(
Data=seq(
from=as.POSIXct("2014-04-01 00:00:00"),
to=as.POSIXct("2014-04-03 00:00:00"),
by ="5 min"
),
value=rnorm(577,0,1)
)
I need to find the average of "value" from 05:00:00 to 17:00:00 and then 17:00:00 to 05:00:00 (of the following day). e.g. from 2014-04-01 05:00:00 to 2014-04-01 17:00:00 and from 2014-04-01 17:00:00 to 2014-04-02 05:00:00
The real data is not continuous and is missing several intervals. I can do it for the same day, but I don't know how to include the time from the following day.