[R] mean of a value of the last 2 hours

S Ellison S.Ellison at LGCGroup.com
Thu Oct 25 19:07:38 CEST 2012


> > I want to add an additional column at the right and get in 
> each row a value which shows the mean of "hunger" of the last two hours.

Isn't that just a moving average?

if so, see http://stackoverflow.com/questions/743812/calculating-moving-average-in-r, which mentions zoo for RollingMeans, TTR for MovingAverages, forecast for ma and a possible solution using filter. One of those might help.

S Ellison

*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}




More information about the R-help mailing list