On Wed, 18 Feb 2004, Ko-Kang Kevin Wang wrote:
>
> One way to make your codes more efficient is to use "vectorisation" --
> vectorise your codes.  I'm not sure where you can find more
> information about it, but an example would be to use the apply()
> function on a data frame instead using a loop.  Avoid loops if you
> can.

Umm. No.  Vectorization is definitely a good thing -- just about the only
coding change that improves both clarity and speed -- but replacing a loop
with apply() is not vectorisation in that sense.

Except for some cases of lapply, the apply functions are mostly clarity
optimisations rather than speed optimisations.


        -thomas

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to