[R] aggregation of a zoo object

2007-05-29 Thread jessica . gervais
Dear all, I am trying to execute the following example: time-c(2000-10-03 14:00:00,2000-10-03 14:10:00,2000-10-03 14:20:00,2000-10-03 15:30:00,2000-10-03 16:40:00,2000-10-03 16:50:00,2000-10-03 17:00:00,2000-10-03 17:10:00,2000-10-03 17:20:00,2000-10-03 18:30:00,2000-10-04 14:00:00,2000-10-04

Re: [R] aggregation of a zoo object

2007-05-29 Thread Achim Zeileis
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:

Re: [R] aggregation of a zoo object

2007-05-29 Thread jim holtman
Here is one way of doing it: time-c(2000-10-03 14:00:00,2000-10-03 14:10:00,2000-10-03 14:20:00, + 2000-10-03 15:30:00,2000-10-03 16:40:00,2000-10-03 16:50:00, + 2000-10-03 17:00:00,2000-10-03 17:10:00,2000-10-03 17:20:00, + 2000-10-03 18:30:00,2000-10-04 14:00:00,2000-10-04 14:10:00, +