On Jul 11, 2011, at 11:23 , M. B wrote:

> Hello,
> I am running R on Linux and have a column of data 10000 points long. I would
> like to take a moving average of say 100 points at a time, so I end up with
> one column of 100 points. What is the simplest way of doing this?  I would
> like to be able to adjust the width of the averaging blocks.
> 

aggregate() to do the averaging, gl() to set up the blocking factor.

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd....@cbs.dk  Priv: pda...@gmail.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.

Reply via email to