On 3/15/06, Thomas Lumley <[EMAIL PROTECTED]> wrote:
> On Wed, 15 Mar 2006, Philippe Grosjean wrote:
>
> > the for() loop is very slow in S-PLUS. This is probably one of the
> > motivation of developing the apply() family of functions (as well as the
> > ugly For() loop) under this system.
> >
> > Now, for() loops are much faster in R. Also, if you look at the R code
> > in apply(), you will realize that there is a for() loop in it!
> >
>
> lapply(), on the other hand, can be faster than a loop. That's why it went
> from being a loop to being internal C code.
>
>         -thomas


Thanks to all for this insights on *apply vs. for loop!

--
Lep pozdrav / With regards,
    Gregor Gorjanc

----------------------------------------------------------------------------------------------------
University of Ljubljana          PhD student
Biotechnical Faculty
Zootechnical Department     URI: http://www.bfro.uni-lj.si/MR/ggorjan
Groblje 3                            mail: gregor.gorjanc <at> bfro.uni-lj.si
SI-1230 Domzale                tel: +386 (0)1 72 17 861
Slovenia, Europe                 fax: +386 (0)1 72 17 888
----------------------------------------------------------------------------------------------------
"One must learn by doing the thing; for though you think you know it,
 you have no certainty until you try." Sophocles ~ 450 B.C.

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

Reply via email to