Skip to content
Prev 388949 / 398506 Next

Calculate daily means from 5-minute interval data

Why would you need a package for this?
That's 12 5-minute intervals per hour and 24 hours per day.
Generate some fake data.
[1] 105120

Reshape the fake data into a matrix where each row represents one
24-hour period.
Now we can summarise the rows any way we want.
The basic tool here is ?apply.
?rowMeans is said to be faster than using apply to calculate means,
so we'll use that.  There is no *rowSds so we have to use apply
for the standard deviation.  I use ?head because I don't want to
post tens of thousands of meaningless numbers.
[1] -0.03510177  0.11817337  0.06725203 -0.03578195 -0.02448077 -0.03033692
[1] 1.0017718 0.9922920 1.0100550 0.9956810 1.0077477 0.9833144

Now whether this is a *sensible* way to summarise your flow data is a question
that a hydrologist would be better placed to answer.  I would have started with
which I just did with some real river data (only a month of it, sigh).
Very long tail.
Even
shows a very long tail.  Time to plot the data against time.  Oh my!
All of the long tail came from a single event.
There's a period of low flow, then there's a big rainstorm and the
flow goes WAY up, then over about two days the flow subsides to a new
somewhat higher level.

None of this is reflected in means or standard deviations.
This is *time series* data, and time series data of a fairly special kind.

One thing that might be helpful with your data would simply be
For my one month sample, the spike showed up very clearly that way.
Because right now, your first task is to get an idea of what the data
look like, and means-and-standard-deviations won't really do that.

Oh heck, here's another reason to go with image(log(m)).
With image(m) I just see the one big spike.
With image(log(m)), I can see that little spikes often start in the
afternoon of one day and continue into the morning of the next.
unusual, days.  From the image, it's clearly ONE rainfall event
that just happens to straddle a day boundary.

This is all very basic stuff, which is really the point.  You want to use
elementary tools to look at the data before you reach for fancy ones.
On Mon, 30 Aug 2021 at 03:09, Rich Shepard <rshepard at appl-ecosys.com> wrote:

Thread (25 messages)

Rich Shepard Calculate daily means from 5-minute interval data Aug 29 Eric Berger Calculate daily means from 5-minute interval data Aug 29 Jeff Newmiller Calculate daily means from 5-minute interval data Aug 29 Rich Shepard Calculate daily means from 5-minute interval data Aug 29 Rich Shepard Calculate daily means from 5-minute interval data Aug 29 Jeff Newmiller Calculate daily means from 5-minute interval data Aug 29 Rui Barradas Calculate daily means from 5-minute interval data Aug 29 Rich Shepard Calculate daily means from 5-minute interval data Aug 29 Rui Barradas Calculate daily means from 5-minute interval data Aug 29 Rich Shepard Calculate daily means from 5-minute interval data Aug 29 Rich Shepard Calculate daily means from 5-minute interval data Aug 29 Andrew Simmons Calculate daily means from 5-minute interval data Aug 29 Rich Shepard Calculate daily means from 5-minute interval data Aug 29 Richard O'Keefe Calculate daily means from 5-minute interval data Aug 29 Jeff Newmiller Calculate daily means from 5-minute interval data Aug 29 Richard O'Keefe Calculate daily means from 5-minute interval data Aug 30 Rich Shepard Calculate daily means from 5-minute interval data Aug 30 Richard O'Keefe Calculate daily means from 5-minute interval data Aug 30 Rich Shepard Calculate daily means from 5-minute interval data Aug 30 Avi Gross Calculate daily means from 5-minute interval data Aug 30 Bert Gunter Calculate daily means from 5-minute interval data Aug 30 Richard O'Keefe Calculate daily means from 5-minute interval data Aug 30 Rich Shepard Calculate daily means from 5-minute interval data Aug 31 Rich Shepard Calculate daily means from 5-minute interval data Aug 31 Jeff Newmiller Calculate daily means from 5-minute interval data Aug 31