Re: [R] aggregate.zoo on bivariate data

2011-08-09 Thread Gabor Grothendieck
On Tue, Aug 9, 2011 at 9:57 AM, Johannes Egner wrote: > On Mon, Aug 8, 2011 at 6:44 PM, Gabor Grothendieck > wrote: >> On Mon, Aug 8, 2011 at 9:16 AM, Johannes Egner >> wrote: >>> Hi, >>> >>> I'm removing non-unique time indices in a zoo time series by means of >>> aggregate. The time series is

Re: [R] aggregate.zoo on bivariate data

2011-08-09 Thread Johannes Egner
On Mon, Aug 8, 2011 at 6:44 PM, Gabor Grothendieck wrote: > On Mon, Aug 8, 2011 at 9:16 AM, Johannes Egner > wrote: >> Hi, >> >> I'm removing non-unique time indices in a zoo time series by means of >> aggregate. The time series is bivariate, and the row to be kept only depends >> on the maximum

Re: [R] aggregate.zoo on bivariate data

2011-08-08 Thread Gabor Grothendieck
On Mon, Aug 8, 2011 at 9:16 AM, Johannes Egner wrote: > Hi, > > I'm removing non-unique time indices in a zoo time series by means of > aggregate. The time series is bivariate, and the row to be kept only depends > on the maximum of one of the two columns. Here's an example: > > x <- zoo(rbind( c(

[R] aggregate.zoo on bivariate data

2011-08-08 Thread Johannes Egner
Hi, I'm removing non-unique time indices in a zoo time series by means of aggregate. The time series is bivariate, and the row to be kept only depends on the maximum of one of the two columns. Here's an example: x <- zoo(rbind( c(1,1), c(1.1, 0.9), c(1.1, 1.1), c(1,1) ), order.by=c(1,1,2,

Re: [R] aggregate.zoo

2010-05-13 Thread Gabor Grothendieck
Here is a second solution where dly and year are as in the original post. The function returns the minimum index and applying that to the sequence numbers of the days in each year we get a vector of the indexes of the yearly minimums and then can use that to subscript dly: f <- function(ix) ix[wh

Re: [R] aggregate.zoo

2010-05-13 Thread Hutchinson,David [PYR]
y[a+b] plot(dly) points(annual.min, pch = 19, col = 'red') -Original Message- From: Achim Zeileis [mailto:achim.zeil...@uibk.ac.at] Sent: Thursday, May 13, 2010 12:29 PM To: Hutchinson,David [PYR] Cc: r-help@r-project.org Subject: Re: [R] aggregate.zoo On Thu, 13 May 2010, Hu

Re: [R] aggregate.zoo

2010-05-13 Thread Achim Zeileis
On Thu, 13 May 2010, Hutchinson,David [PYR] wrote: I have been using aggregate function to determine the annual minimum in a daily time series. However, I was also hoping to determine the date of occurrence without having to loop through each year to identify the date of each minimum returned fr

[R] aggregate.zoo

2010-05-13 Thread Hutchinson,David [PYR]
I have been using aggregate function to determine the annual minimum in a daily time series. However, I was also hoping to determine the date of occurrence without having to loop through each year to identify the date of each minimum returned from aggregate(). Is there a more convenient way of doin