Hello On 2/16/10, julien cuisinier <j_cuisin...@hotmail.com> wrote: > 1. apply Vs for loop > > >> Seems apply is (was?) supposed to be faster than using for loop, some > posts mention that it is now more of a cosmetic function (wrapper for "for > loop") making the code essentially neater. Any thoughts/opinion/experience on > this more than welcome. > > >> Running the very simple function attached, I end up with for loop quicker > than apply function....but may be do I not use the apply function properly? > Check this [1] for a discussion of vectorisation vs looping. It seems that vectorisation is not always better than looping. Liviu
[1] http://www.r-project.org/doc/Rnews/Rnews_2008-1.pdf ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.