[R] Creating functions with a loop.

Etienne Larrivée-Hardy etienne.larrivee-hardy.1 at ulaval.ca
Tue May 22 16:06:15 CEST 2012


Hi

I am trying to create n functions where each function is defined in function one step before, i.e. something like

ff.k(x) = ff.j(x) - sum(1:j),      for j=k-1

Is it possible? If it isn't and I manually create each function then is their a way to call them through a loop?  My objective is to calculate something like

result.k = ff.k(x1)/ff.k(x2)      for k in 2:n

Thank you for your time,
Etienne


More information about the R-help mailing list