[R] functions available for use with aggregate?

Spencer Graves spencer.graves at pdf.com
Thu Oct 13 00:49:11 CEST 2005


	  1.  There is also "aggregate.zoo" in the "zoo" package.

	  2.  If your question is which functions can be used for the "FUN" 
argument, you can write your own.  For example:

 > set.seed(1)
 > tstDF <- data.frame(x=rep(1:4, e=2),
+                     y=rnorm(8))
 > aggregate(tstDF[2], tstDF[1],
+           function(z)max(z)/min(z))
   x          y
1 1 -0.2931474
2 2 -1.9090787
3 3 -0.4016093
4 4  1.5147327
 >
	  spencer graves

Sundar Dorai-Raj wrote:

> 
> t c wrote:
> 
>>What are the functions available for use with “aggregate”?  Where can a reference to them be found?
>>
>> 
> 
> 
> Since aggregate is a S3 generic, you can use
> 
> methods(aggregate)
> 
> to see what objects have an "aggregate" method. For me, I have the 
> following:
> 
>  > methods(aggregate)
> [1] aggregate.data.frame aggregate.default    aggregate.frm*
> [4] aggregate.ts
> 
>     Non-visible functions are asterisked
>  >
> 
> See ?methods for more details.
> 
> HTH,
> 
> --sundar
> 
> ______________________________________________
> R-help at 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

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

spencer.graves at pdf.com
www.pdf.com <http://www.pdf.com>
Tel:  408-938-4420
Fax: 408-280-7915




More information about the R-help mailing list