[R] aggregate question...

Jeff D. Hamann jeff.hamann at forestinformatics.com
Thu Mar 31 19:17:34 CEST 2005


Is there a function, like aggregate, that allows users to bin values?

I've got to break down a data frame into classes of 5cm (or something like
it), and I only know how to do it using code like,

signif <- symnum( stems$dbh,
                 corr = FALSE,
                 na = FALSE,
                 cutpoints = c(0,10,20,30,40,999),
                 symbols = c(0,10,20,30,40) )

rt <- data.frame( stems$expf,
		  signif = ordered( signif,
                    levels = c(0,10,20,30,40) )

st <- aggregate( rt$stems.expf, by=list(signif), sum )

Is there a one line command to do this?

Jeff D. Hamann
Forest Informatics, Inc.
PO Box 1421
Corvallis, Oregon 97339-1421
phone 541-754-1428
fax 541-752-0288
jeff.hamann at forestinformatics.com

More information about the R-help mailing list