[R] Yet another help needed

Gabor Grothendieck ggrothendieck at gmail.com
Mon May 1 04:55:30 CEST 2006


Look at
?filter
?embed
rollmean in the zoo package
running in the gtools package
runmean in the caTools package

The last one is probably the fastest.

On 4/30/06, Guojun Zhu <shmilylemon at yahoo.com> wrote:
> I have a big data.frame with abou 20 column and 60,000
> rows for analyze.  Let us say I had a column "a".  I
> want to generate a new column which value should be
> the average of the 60 a before the current column.
> Let us say very row is time t_i.  I need to calculate
> a(t_(i-60))+a(t(i-59)+...+a(t(i-1)).  Also I want to
> get another number by run regression of
> a(t(i-60)),..., a(t(i-1)) on b(t(i-60)),...,b(t(i-1)).
>  Is there any simple densed code for this?  Thanks.
>
> ______________________________________________
> 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
>




More information about the R-help mailing list