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 problem

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] -

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 jvad...@usgs.gov 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

[R] Problem with nested for-loop

2013-03-25 Thread Curtis Burkhalter
Hello, I'm working on a problem using nested for-loops and I don't know if it's a problem with the order of the loops or something within the loop so any help with the problem would be appreciated. To briefly set up the problem. I have 259 trees (from 11 different species, of unequal count for