[Rd] How to loop through a set of data and to evaluate a function?

NicoNYC nicolas.georges at us.calyon.com
Thu Jul 24 16:39:07 CEST 2008


Hi,
I will explain my problem :
I would like to loop through a set of data taking the set 100 points at a
time.  At each iteration I'd like to evaluate a function over this set.  In
each subsequent iteration i add the next point to my sub set and remove the
oldest and evaluate the function again (something like a moving window).

Small example : this is my data:
1
2
3
..
10

with a moving window of 3 points, i would like to evaluate the following
f(1,2,3)
f(2,3,4)
f(3.4.5)
...
f(8,9,10)

Thank you!
-- 
View this message in context: http://www.nabble.com/How-to-loop-through-a-set-of-data-and-to-evaluate-a-function--tp18633260p18633260.html
Sent from the R devel mailing list archive at Nabble.com.



More information about the R-devel mailing list