Dear Joshua thank you for the pointer to the width element. Actually still with na.pad=TRUE it doesn't seem to work but attaching an extra row of NAs did.
A1a<-zoo(c( NA, NA, 1,2,3,4,5,6, NA, NA)) A1b<-rollapply(A1a,4,mean, na.rm=TRUE, na.pad=FALSE, align="right") A1c<-rollapply(A1a,4,mean, na.rm=TRUE, na.pad=TRUE, align="right") cbind(A1a,A1b, A1c) A1a A1b A1c 1 NA NA NA 2 NA NA NA 3 1 NA NA 4 2 1.5 1.5 vs. the same outcome with another NA > cbind(A1a,A1b, A1c) A1a A1b A1c 1 NA NA NA 2 NA NA NA 3 NA NA NA 4 1 1.0 1.0 5 2 1.5 1.5 But for now the issue is solved with the workaround. ----- Christian Langkamp christian.langkamp-at-gmxpro.de -- View this message in context: http://r.789695.n4.nabble.com/Zoo-bug-tp2287282p3065881.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org 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.