Skip to content
Prev 243569 / 398513 Next

Difference between loops and vectorization

Santosh Srinivas wrote:
Strange. "loop vectorization" gives a few hundred of hits, that tell you
that loops are not as bad in R (compared to S) in many cases. "apply" is
probably the least important vectorization method in R, but I admit that
some texts make us believe that it is the point where you show your
R-talents.

"adply" is different: it is a rather complex function from package plyr by
Hadley Wickham. This package provides some elegant orthogonal functions
under a unified concept. I found it appealing at the first look, but I am
less frequently using it nowadays because it can be terribly slow.

Try the chapter in 

http://www.burns-stat.com/pages/Tutor/R_inferno.pdf

Dieter