[R] Sweeping a zoo series

2010-08-11 Thread steven mosher
Given a long zoo matrix, the goal is to sweep out a statistic from the entire length of the sequences. longzoomatrix-zoo(matrix(rnorm(720),ncol=6),as.yearmon(outer(1900,seq(0,length=120)/12,+))) cnames-c(12345,23456,34567,45678,56789,67890) colnames(longzoomatrix)-cnames longzoomatrix[1:24,]

Re: [R] Sweeping a zoo series

2010-08-11 Thread Gabor Grothendieck
On Wed, Aug 11, 2010 at 12:22 PM, steven mosher mosherste...@gmail.com wrote: Given a long zoo matrix, the goal is to sweep out a statistic from the entire length of the sequences.  longzoomatrix-zoo(matrix(rnorm(720),ncol=6),as.yearmon(outer(1900,seq(0,length=120)/12,+)))  

Re: [R] Sweeping a zoo series

2010-08-11 Thread steven mosher
The colMeans comes closest, for a single series the assume you have 100 years of monthly data. The mean you want to scale by is the mean for a restricted period in the center of the series.. say 1950-1960 for this period you have the average jan (1950-1960) average feb, ect. your final series

Re: [R] Sweeping a zoo series

2010-08-11 Thread Gabor Grothendieck
On Wed, Aug 11, 2010 at 2:38 PM, steven mosher mosherste...@gmail.com wrote: The colMeans comes closest, for a single series the assume you have 100 years of monthly data. The mean you want to scale by is the mean for a restricted period in the center of the series.. say 1950-1960 for this

Re: [R] Sweeping a zoo series

2010-08-11 Thread Gabor Grothendieck
On Wed, Aug 11, 2010 at 2:44 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Wed, Aug 11, 2010 at 2:38 PM, steven mosher mosherste...@gmail.com wrote: The colMeans comes closest, for a single series the assume you have 100 years of monthly data. The mean you want to scale by is the