Schwarz,Paul wrote:

Dear R-Help readers,

I suspect that this question must be a FAQ, but my investigation of the archives has 
not been very revealing.  Is there an R function for calculating moving averages of 
time series objects?



library(gregmisc)
?running
test <- ts(rnorm(100))

test2 <- running(test, fun=median, width=10)
length(test2)
[1] 91

you want fun=mean

Kjetil

--

Kjetil Halvorsen.

Peace is the most effective weapon of mass construction.
              --  Mahdi Elmandjra

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to