Dennis: I will check this out tonight and let you know, it seems promising. Either way, thanks for the suggestion. Brad
On Fri, Apr 9, 2010 at 12:03 PM, Dennis Murphy [via R] < ml-node+1819642-2015310724-118...@n4.nabble.com<ml-node%2b1819642-2015310724-118...@n4.nabble.com> > wrote: > Hi: > > Not exactly elegant, but here's one approach: > library(zoo) > x <- zoo( rpois(100, 40) ) > w <- rollapply(x, 5, mean, by = 5, align = c('left')) > x2 <- rep(w, each = 5) > > Does that work? > > HTH, > Dennis > > > On Fri, Apr 9, 2010 at 12:32 AM, Brad Patrick Schneid <[hidden > email]<http://n4.nabble.com/user/SendEmail.jtp?type=node&node=1819642&i=0>>wrote: > > > > > > Hi, > > Sorry ahead of time for not including data with this question. > > Using rollapply to calculate mean values for 5 day blocks, I'd use this: > > > > Roll5mean <- rollapply(data, 5, mean, by=5, align = c("left")) > > > > My question is, can someone tell me how to fill in the days between each > of > > these means with the previously calculated mean? If this doesn't make > > sense, I will clarify and provide data for an example. > > > > Thanks. > > Brad > > -- > > View this message in context: > > > http://n4.nabble.com/fill-in-values-between-rollapply-tp1816885p1816885.html > > Sent from the R help mailing list archive at Nabble.com. > > > > ______________________________________________ > > [hidden > > email]<http://n4.nabble.com/user/SendEmail.jtp?type=node&node=1819642&i=1>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. > > > > [[alternative HTML version deleted]] > > ______________________________________________ > [hidden > email]<http://n4.nabble.com/user/SendEmail.jtp?type=node&node=1819642&i=2>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. > > > ------------------------------ > View message @ > http://n4.nabble.com/fill-in-values-between-rollapply-tp1816885p1819642.html > To unsubscribe from "fill in" values between rollapply, click here< (link > removed) ==>. > > > -- View this message in context: http://n4.nabble.com/fill-in-values-between-rollapply-tp1816885p1819968.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]] ______________________________________________ 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.