Re: [R] for loop in R

2017-01-12 Thread jennifer . sheng2002
That is right, Bob. Only one loop for now, since I do not know how to set up the 2nd loop. Any advice from the community? Thank you! Sent from my iPhone > On Jan 12, 2017, at 4:49 PM, Robert Sherry wrote: > > I only see one for loop in your code. I am wondering if you want a second for > l

Re: [R] for loop in R

2017-01-12 Thread Robert Sherry
I only see one for loop in your code. I am wondering if you want a second for loop based upon the length of newdata. I would also think that you do not need the second call to set.seed. Bob On 1/12/2017 4:44 PM, Jennifer Sheng wrote: Dear friends, I am working on a double loop using for. On

[R] for loop in R

2017-01-12 Thread Jennifer Sheng
Dear friends, I am working on a double loop using for. One level of loop is to predict N times for each subject, and the second level is to predict M times for the every subject, one subject after one subject. Please note every subject have different N or M rows of data. Any advice? Thank yo

Re: [R] "for" loop in R - strange behaviour

2014-01-29 Thread Peter Alspach
-project.org Subject: [R] "for" loop in R - strange behaviour Hi, I notice the following from a "for" loop in R, which seems strange to me: When I do this: --- first <- 0 nstep <- 10 N <- 14 while(first < N) { print("---> ") last <- f

Re: [R] "for" loop in R - strange behaviour

2014-01-29 Thread Duncan Murdoch
On 29/01/2014 11:32 AM, Supriya Jain wrote: Hi, I notice the following from a "for" loop in R, which seems strange to me: When I do this: --- first <- 0 nstep <- 10 N <- 14 while(first < N) { print("---> ") last <- first + nstep if(last > N) last <- N #start <- first+2 f

[R] "for" loop in R - strange behaviour

2014-01-29 Thread Supriya Jain
Hi, I notice the following from a "for" loop in R, which seems strange to me: When I do this: --- first <- 0 nstep <- 10 N <- 14 while(first < N) { print("---> ") last <- first + nstep if(last > N) last <- N #start <- first+2 for(i in (first+2):last)#