On Tue, 26 Jun 2007, antonio rodriguez wrote:

> Hi,
>
> I swear I have read almost all the posted messages about this issue, but
> it's evident I couldn't find an answer (surely esay) to my problem. What
> I want is the following:
>
> Make  8 days aggregates from a daily series like this (dput output):

I'm not sure which days you want to aggregate exactly. If you want to
replace the observations from 1985-01-02 until 1985-01-09 by a single
observation, maybe you want something like
  new.time <- as.Date(8 * floor(as.numeric(time(z))/8) + 7)
  z2 <- aggregate(z, new.time, mean)
which gives averages for 8 days (anchored on the last day of the 8-day
period).

Does this what you're looking for? Look at the "zoo" vignettes for more
information/examples.
Z

______________________________________________
[email protected] mailing list
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.

Reply via email to