[R] moving correlation coef ?

Spencer Graves spencer.graves at pdf.com
Wed Jun 29 16:57:38 CEST 2005


or ?rapply in package zoo.

	  spencer graves

Sundar Dorai-Raj wrote:

> 
> vincent wrote:
> 
>>Hello,
>>
>>R gives us the correlation functions cor(). (Many thanks ;-))
>>Does it also exist a "moving correlation" coefficient ?
>>(like the moving average).
>>If not, could someone give me some infos or link
>>on how to practically implement such a function in R.
>>
>>(I did search for "moving correlation" on the R homepage
>>but didn't find anything.)
>>
>>Thank you.
>>Vincent
>>
> 
> 
> 
> See ?running in the gtools package:
> 
> library(gtools)
> X <- rnorm(100); Y <- rnorm(100)
> running(X, Y, cor)
> 
> HTH,
> 
> --sundar
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

spencer.graves at pdf.com
www.pdf.com <http://www.pdf.com>
Tel:  408-938-4420
Fax: 408-280-7915




More information about the R-help mailing list