[R] as.day() Function (zoo question)
ggrothendieck at gmail.com
Mon Sep 22 19:07:51 CEST 2008
chron values are represented as day + fraction of a day so:
aggregate(z, floor, mean)
On Mon, Sep 22, 2008 at 12:56 PM, stephen sefick <ssefick at gmail.com> wrote:
> I am was going to look at the as.yearmon function in the zoo package
> and write a as.day function to aggregate a time series of 96
> observations per day into the mean for each day, but I don't know how
> to look at the code so that I can convert it into something I can use.
> On top of that I believe that it is probably an S3 method and I
> haven't quite gotten that far in my programming experience.
> How I want the mean for each day. the real data set has NA s randomly
> t1 <- chron("1/1/2006", "00:00:00")
> t2 <- chron("12/31/2006", "23:45:00")
> deltat <- times("00:15:00")
> tt <- seq(t1, t2, by = times("00:15:00"))
> value <- rnorm(35040)
> z <- zoo(value, tt)
> Stephen Sefick
> Research Scientist
> Southeastern Natural Sciences Academy
> Let's not spend our time and resources thinking about things that are
> so little or so large that all they really do for us is puff us up and
> make us feel like gods. We are mammals, and have not exhausted the
> annoying little problems of being mammals.
> -K. Mullis
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help