[R] Doing SQL GROUP BY in R

Vadim Ogranovich vograno at evafunds.com
Fri Apr 2 23:28:41 CEST 2004


You might want to look at ?table and ?xtab. See also ?tapply for use of
general functions (other than just COUNT) with GROUP BY.

HTH,
Vadim

> -----Original Message-----
> From: JFRI (Jesper Frickmann) [mailto:jfri at novozymes.com] 
> Sent: Friday, April 02, 2004 1:06 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Doing SQL GROUP BY in R
> 
> 
> I want a list of the number of times some factor levels 
> appear together, similar to the following SQL statement:
> 
> SELECT A, B, COUNT(C) FROM TBL GROUP BY A, B
> 
> How do I do that with a data.frame in R?
> 
> Thanks,
> Jesper Frickmann
> Statistician, Quality Control
> Novozymes North America Inc.
> 77 Perry Chapel Church Road
> Franklinton, NC 27525
> USA
> Tel. +1 919 494 3266
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list 
> https://www.stat.math.ethz.ch/mailman/listinfo> /r-help
> PLEASE 
> do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list