Skip to content
Prev 307716 / 398503 Next

replacing ugly for loops

I hate to decline such praise, but honesty demands that I must.

In fact, my solution is **not** fully vectorized at all! The tapply()
and mapply() calls are, in fact, in some sense hidden loops at the
interpreted levels. They do have the virtue of being true to R's
functional paradigm, but they are loops, nevertheless. For this
reason, they may not be more efficient then the explicit loops you've
written. But I hope the code is more transparent.

AndI did send a follow-up note to the list both acknowledging my
erroneous accusation that you did not provide data and confirming that
my proposed solution worked with the example you did, in fact,
provide.

But thanks for the kind words anyway.

-- Bert
On Thu, Oct 11, 2012 at 2:16 PM, andrewH <ahoerner at rprogress.org> wrote: