Re: [R] zoo:rollapply by multiple grouping factors

2011-04-04 Thread Mark Novak
#x27;aggregate' vs. 'ave' in general? -mark On 4/3/11 3:27 PM, Gabor Grothendieck wrote: Try ave: dat$cv<- ave(dat$Count, dat[c("Site", "Plot", "Sp")], FUN = function(x) rollapply(zoo(x), 2, cv, na.pad = TRUE, align = "right"))

[R] zoo:rollapply by multiple grouping factors

2011-04-03 Thread Mark Novak
# Hi there, # I am trying to apply a function over a moving-window for a large number of multivariate time-series that are grouped in a nested set of factors. I have spent a few days searching for solutions with no luck, so any suggestions are much appreciated. # The data I have are for the