Re: [R] Problem with nested for-loop

2013-03-26 Thread Curtis Burkhalter
Hey Jean, This appears to have worked!! Thank you so much, this is an immense help to me. Best On Tue, Mar 26, 2013 at 11:33 AM, Adams, Jean wrote: > Thanks. That helps. > > Using the example data you sent, I came up with this loop. See if it does > the trick for you. > > niter <- 2 > nspp <-

Re: [R] Problem with nested for-loop

2013-03-26 Thread Adams, Jean
Thanks. That helps. Using the example data you sent, I came up with this loop. See if it does the trick for you. niter <- 2 nspp <- 11 ntrees <- 22 lnbm <- matrix(NA, niter, ntrees) for(i in 1:niter) { for(j in 1:ntrees) { k <- j1data$its==i & j1data$spp==predictdata$spp[j] lnbm[i, j] <- j1dat

Re: [R] Problem with nested for-loop

2013-03-26 Thread Adams, Jean
It would be helpful to see what your data frames look like ... perhaps you could share the first few rows of each with us. dput(head(j1data)) dput(head(predictdata)) Jean On Mon, Mar 25, 2013 at 9:29 PM, Curtis Burkhalter < curtisburkhal...@gmail.com> wrote: > Hello, > > I'm working on a prob