Re: [R] rolling around rollapply in a zoo

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Wed 04 Oct 2006 - 00:18:35 GMT

As indicated in ?rollmean there are only ts and zoo methods for rollapply. Try

   rollapply(zoo(1:10), 3, mean)

Also note that as indicated in ?rollmean, rollmean does have a default method:

   rollmean(1:10, 3)

On 10/3/06, Horace Tso <Horace.Tso@pgn.com> wrote:
> Hi list,
>
> I'm a little confused about rollapply in zoo. There is written that
> rollapply has replaced rapply in version 1.2-0 which is what i have. But
> when I tried,
>
> > rollapply(1:100, 10, mean)
>
> I got,
>
> Error in rollapply(1:100, 10, mean) : no applicable method for
> "rollapply"
>
> So I went back to the good old rapply
>
> > rapply(1:100, 10, mean)
> Error in rapply(1:100, 10, mean) : no applicable method for
> "rollapply"
> In addition: Warning message:
> 'rapply' is deprecated.
> Use 'rollapply' instead.
> See help("Deprecated")
>
> Is there a more updated version of zoo?
>
> Thanks.
>
> Horace W. Tso
>
> =======================================
> >sessionInfo()
> Version 2.3.1 (2006-06-01)
> i386-pc-mingw32
>
> attached base packages:
> [1] "splines" "methods" "datasets" "stats" "tcltk" "utils"
>
> [7] "graphics" "grDevices" "base"
>
> other attached packages:
> lmtest Hmisc tseries quadprog zoo MASS
> Rpad
> "0.9-18" "3.0-12" "0.10-1" "1.4-8" "1.2-0" "7.2-27.1"
> "1.1.1"
>
> ______________________________________________
> R-help@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
> and provide commented, minimal, self-contained, reproducible code.
>



R-help@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 and provide commented, minimal, self-contained, reproducible code. Received on Wed Oct 04 10:22:51 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 04 Oct 2006 - 01:30:07 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.