[R] using apply function and storing output

Gabor Grothendieck ggrothendieck at gmail.com
Fri Oct 15 23:32:52 CEST 2010


On Fri, Oct 15, 2010 at 6:46 AM, David A. <dasolexa at hotmail.com> wrote:
>
> Thanks Dennis,
>
> I don't think it was a problem of not feeding in a function for rollapply(), because I was using mean() and my co.var() function in the FUN argument.
> The key part seems to be the transformation that zoo() does to the matrix. If I do the same transformation to my original matrix, the rollapply() function now works fine.
>

rollapply has ts and zoo methods so you have to pass it an object of
one those classes:

> methods(rollapply)
[1] rollapply.ts*  rollapply.zoo*

   Non-visible functions are asterisked


-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-help mailing list