[R] Recursive algorithm

Megh Dal megh700004 at yahoo.com
Mon Nov 1 11:12:12 CET 2010


Dear friend, I have to construct some recursive algorithm for which I used some for loop like:

res <- vector(length=10000)
res[1] = 0
for (i in 2:(10000+1)) res[i] <- res[i-1]*........some function

I have noticed that this is taking too much time. Is there any way to speed up things?

Thanks,



More information about the R-help mailing list