[R-sig-hpc] Avoiding looping on vector with stochastic dependency

Guillaume Chapron carnivorescience at gmail.com
Sun Dec 28 19:48:16 CET 2008


Thanks for your reply. In fact my code example was simplified from  
something more general

for (i in 2:length(w[,1])) {
		w[i,] <- foo( w[i-1,] )
	}

and I was trying to write this without a loop. I will look at the  
method you describe, but  I'm not sure if it can still be applied if  
foo() is quite complex. (sorry for sending this to the wrong list, I  
thought this one was about everything that can make R running faster!)

Cheers

Guillaume



More information about the R-sig-hpc mailing list