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