Skip to content

For loop

3 messages · 20c, Tal Galili, Joshua Wiley

#
Hi,

In general, the way to speed up for loops in R is to avoid them.  It
looks like some of the operations could be vectorized (e.g., h[1,k] +
vv[j-1,k+1] looks like you could just add entire columns at once).  If
you provide sample data for all the variables in your loop, it will be
possible to give you more detailed feedback.

Cheers,

Josh

2010/10/30 20c <20c at email.it>: