[R-sig-eco] help with script

2011-08-11 Thread Kátia Emidio
Dear all, Attached there is a table, with columns subparcel, nrindividual, diameter. Within each subparcel, for each nrindividual I need to sum up the diameter of others nrindividuals lying in the subparcel, which diameter is larger than or equal the fixed nrindividual, excluding the diameter of

Re: [R-sig-eco] help with script

2011-08-11 Thread Travis Belote
I will be in a wilderness area until august 22 collecting data and will set up an automated email reply. Can you please remove me from this list? I will re-subscribe when I return. Thanks! Travis R. Travis Belote The Wilderness Society Research Department Northern Rockies Regional Office 503 W

Re: [R-sig-eco] help with script

2011-08-11 Thread Tom_Philippi
Katia-- One approach would be to order the dataframe by subparcel and (decreasing) diameter within subparcels. then use tapply or aggregate to compute cumulative sums of diameters within each subparcel. If you have lots of ties, that approach would give the individuals (trees?) random order

Re: [R-sig-eco] help with script

2011-08-11 Thread Zapata, Mauricio
Katia, Try this... ### --- ## read table tablee-read.table(table.txt,header=T) ## Function fun1-function(i,tablee){ sum(tablee[tablee[,subparcels]==tablee[i,subparcels] tablee[,diameter]=tablee[i,diameter],diameter]) } ## Response