[R] aggregate question...

From: Jeff D. Hamann <jeff.hamann_at_forestinformatics.com>
Date: Fri 01 Apr 2005 - 03:17:34 EST


R-folks,

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@forestinformatics.com
http://www.forestinformatics.com

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri Apr 01 03:23:30 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:58 EST