[R] How to speed up the for loop by releasing memeory

2012-12-15 Thread Yong Wang
Dear list; How can I speed up the run of following code (illustrative) # con-vector(numeric) for (i in 1:limit) { if(matched data for the ith item found) { if(i==1) {con-RowOfMatchedData } else

Re: [R] How to speed up the for loop by releasing memeory

2012-12-15 Thread Jeff Newmiller
Please read the posting guide. You need to provide reproducible code (please simplify, but make sure it illustrates your problem and runs) to communicate clearly what problem you are trying to solve. Chances are good that you don't need any for loop at all, but without running code we can't

Re: [R] How to speed up the for loop by releasing memeory

2012-12-15 Thread Duncan Murdoch
On 12-12-15 10:10 AM, Yong Wang wrote: Dear list; How can I speed up the run of following code (illustrative) # con-vector(numeric) for (i in 1:limit) { if(matched data for the ith item found) { if(i==1)

Re: [R] How to speed up the for loop by releasing memeory

2012-12-15 Thread Patrick Burns
You are in Circle 2 of 'The R Inferno'. You are wise to want to leave. http://www.burns-stat.com/pages/Tutor/R_inferno.pdf Pat On 15/12/2012 15:10, Yong Wang wrote: Dear list; How can I speed up the run of following code (illustrative)