Re: [R] Doing SQL GROUP BY in R

2004-04-03 Thread pallier
JFRI (Jesper Frickmann) wrote: I want a list of the number of times some factor levels appear together, Say a and b are the names of the factors: table(a,b) table(a:b) aggregate(a,list(a=a,b=b),length) Christophe Pallier http://www.pallier.org __

RE: [R] Doing SQL GROUP BY in R

2004-04-02 Thread Vadim Ogranovich
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:[EMAIL PROTECTED] Sent: Friday, April 02, 2004 1:06 PM To: [EMAIL PROTECTED] Subject:

Re: [R] Doing SQL GROUP BY in R

2004-04-02 Thread Pierre Kleiber
Assuming you have a data.frame, dat, with coluns A and B, I think what you want would be: table(paste(dat$A,dat$B)) JFRI (Jesper Frickmann) wrote: 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