Richard O'Keefe
2021-Aug-30 23:18 UTC
[R] Calculate daily means from 5-minute interval data
I made up fake data in order to avoid showing untested code. It's not part of the process I was recommending. I expect data recorded every N minutes to use NA when something is missing, not to simply not be recorded. Well and good, all that means is that reshaping the data is not a trivial call to matrix(). It does not mean that any additional package is needed or appropriate and it does not affect the rest of the process. You will want the POSIXct class, see ?DateTimeClasses. Do you know whether the time stamps are in universal time or in local time? Above all, it doesn't affect the point that you probably should not be doing any of this. On Tue, 31 Aug 2021 at 00:42, Rich Shepard <rshepard at appl-ecosys.com> wrote:> > On Mon, 30 Aug 2021, Richard O'Keefe wrote: > > > Why would you need a package for this? > >> samples.per.day <- 12*24 > > > > That's 12 5-minute intervals per hour and 24 hours per day. > > Generate some fake data. > > Richard, > > The problem is that there are days with fewer than 12 recorded values for > various reasons. > > When testing algorithms I use small subsets of actual data rather than fake > data. > > Thanks for your detailed procedure. > > Regards, > > Rich > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
On Tue, 31 Aug 2021, Richard O'Keefe wrote:> I made up fake data in order to avoid showing untested code. It's not part > of the process I was recommending. I expect data recorded every N minutes > to use NA when something is missing, not to simply not be recorded. Well > and good, all that means is that reshaping the data is not a trivial call > to matrix(). It does not mean that any additional package is needed or > appropriate and it does not affect the rest of the process.Richard, The instruments in the gauge pipe don't know to write NA when they're not measuring. :-) The outage period varies greatly by location, constituent measured, and other unknown factors.> You will want the POSIXct class, see ?DateTimeClasses. Do you know whether > the time stamps are in universal time or in local time?The data values are not timestamps. There's one column for date a second colume for time and a third column for time zone (P in the case of the west coast.> Above all, it doesn't affect the point that you probably should not > be doing any of this.? (Doesn't require an explanation.) Rich