[R] Yet another help needed

Guojun Zhu
Mon, 01 May 2006 02:31:35 -0000

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.