Re: [R] Trying to perform an inner loop a random number of times

2011-04-28 Thread Galen Moore
nks again, Galen -Original Message- From: jim holtman [mailto:jholt...@gmail.com] Sent: Wednesday, April 27, 2011 21:32 To: galen.a.mo...@gmail.com Cc: r-help@r-project.org Subject: Re: [R] Trying to perform an inner loop a random number of times What exactly are you trying to accomplish?

Re: [R] Trying to perform an inner loop a random number of times

2011-04-27 Thread jim holtman
What exactly are you trying to accomplish? A little debugging might show you what the problem is. I put the following statement in the loop right after the assignment to 'newrow': print(newrow) What I saw is that you never reset 'iter' and once it reached a maximum length, you were continuing t

[R] Trying to perform an inner loop a random number of times

2011-04-27 Thread Galen Moore
Grateful for any hints as to why I'm not getting the inner loop to cycle the expected number of times. Code and one run's results below. Thanks, Galen > # source("looptest.r") > sp<-numeric() > iter<-numeric() > rn<-numeric() > ds<-data.frame(sp, iter, rn) > > for (sp in