[R] Zoo series to a date time stamp that is regular

Gabor Grothendieck ggrothendieck at gmail.com
Tue Jun 29 01:21:13 CEST 2010


On Mon, Jun 28, 2010 at 7:08 PM, stephen sefick <ssefick at gmail.com> wrote:
> There are NA most likely.  Will aggregate pull the value out?  Again,
> thanks for all of the help.
>
> Stephen

I assume you mean NAs in the data.   They are handled by the function
you give to aggregate so just make sure you use something appropriate.

z <- zoo(c(1, NA, 3, 4), 0:3)
aggregate(z, time(z) %/% 2, function(x) mean(x, na.rm = TRUE))



More information about the R-help mailing list