
Dear All,
I wish to calculate the Gini index (ineq from same package) and some other indices for the diameter distribution of each plot (df dgtot).

dgtot:
    IDPlot    Diameter(cm) 
1        4 34.0
2        4 23.0
3        4 38.0
...
51       5 16.0
52       5  8.0
53       5  9.0
...
5301      140 25.0
5302      140 12.0
5303      140  7.0

I use:
> aggregate(dgtot,by=list(dgtot$IDSupr),FUN=ineq(dsp))

where
dsp <- function(x) # compute frequency distribution for each plot
{
 cd<-seq(5,max(x),by=2)
 Fi <<- table(cut(x, br = seq(5, max(x)+1, 2), right = FALSE))
 K <- length(names(Fi))
}

but, the result was:
Error in sort.int(x, na.last = na.last, decreasing = decreasing, ...) : 'x' must be atomic

I'm at the beginning in R and I kindly request your experienced help.

Thank you,
Marius
 Teodosiu










      ____________________________________________________________________________________
Looking for last minute shopping deals?  

	[[alternative HTML version deleted]]

