[R] Efficiency of for-loop in R

jim holtman jholtman at gmail.com
Fri Dec 28 01:39:32 CET 2007


Exactly "what is the problem you are trying to solve"?  Could you
"provide commented, minimal, self-contained, reproducible code"?

A lot depends on what you are trying to do,  There might be other
ways, in R, than a 'for' loop to solve your problems.

On Dec 27, 2007 6:44 PM, Tong Wang <wangtong at usc.edu> wrote:
> Hi,
>   I just realized that in Matlab, as long as memory is pre-allocated, doing for-loop doesn't cost more time than doing things in vector form.
>   But it seems in R, it still cost a lot to do for-loop.  Is there any improvement in R that I missed. Thanks a lot.
>
> Merry Xmas Everyone !
>
> ______________________________________________
> R-help at 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.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?



More information about the R-help mailing list