Re: [R] for loop, my program does not make a cycle

2008-05-14 Thread jim holtman
You got exactly what you were asking for: the value the last time through the loop. If you are trying to capture all 11 values, then you might consider a list: d<-as.vector(levels(a2$combin2)) a1 <- b1 <- vector('list',11) for (i in 1:11){ a1[[i]] <-a2[a2$combin2%in%d[i],] b1[[i]]<-b0[b0$Date%in%

[R] for loop, my program does not make a cycle

2008-05-14 Thread J S
Dear R community, I wrote a small program using for loop but it does not make cycles. My data: Dataframes: a2, a1, b0 and b1. Vector: d I would like to get b1 for each of i., i.e. totally 11. However, the program gives me b1 only for the last i =11. d<-as.vector(levels(a2$combin2)) for (