Skip to content
Prev 267780 / 398502 Next

Loop: noob question

Inline below.

On Fri, Aug 5, 2011 at 10:23 AM, R. Michael Weylandt
<michael.weylandt at gmail.com> wrote:
No. That wasn't my point at all. In this case, vectorizing doesn't
seem to help because you still must do a loop (via *ply) in R. My
point was only that replicate() is another form of a loop and that,
when possible, vectorizing is preferable. Here I don't think it's
possible. However, I interpreted your advice as a general
prescription, and that was the problematic part.
I apologize for being unclear. I **do not know** this to be true,
although one might guess it to be so by looking at the apply() code,
which has some overhead in it before calling vapply() to do the actual
loop. However, I defer to experts for confirmation -- or not.

Cheers,
Bert

I would have guessed