On Tue, 29 May 2007 [EMAIL PROTECTED] wrote:

> # then I want to do the sum per hour
>
> z_sum_per_hour <- aggregate(na.omit(z), function(x) as.POSIXct(trunc(x,
> "hour")),sum)
> Warning message:
> some methods for “zoo” objects do not work if the index entries in
> ‘order.by’ are not unique in: zoo(rval[i], x.index[i])
>
> Do anyone has an idea how to avoid that ?

The warning does not come from the aggregate() call, but from the
na.omit() call. After omitting the NAs, you have still duplicated time
stamps, hence the warning is issued again. After that, aggregating works
fine and produces no warnings.
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