search for: bal2

Displaying 1 result from an estimated 1 matches for "bal2".

Did you mean: bal
2011 Jul 21
1
nested loop for
...ma<-rep (1:40) P<-seq(1,4, 1) Plot<-rep(P,10) dbh2<-rnorm(40, mean=200, sd=5) SBA2<-rnorm(40, mean=10, sd=1) As I want to calculate the basal area of larger trees in each stand (i.e., the compare tree to tree the dbh and for each individual sum the stand basal area of larger trees) BAL2<-rep(0,length(Pma)) aa<-rep(0,length(Pma)) Now I have programed a for loop to do this calculation, and one plot it works quite well: kk<-data.frame(Pma, Plot, dbh2, SBA2, BAL2, aa) kkk<-kk[kk$Plot=="1",] The loop: for(j in 1:length(kkk$Pma)){ for(i in...