[R] query in R

Gregor Gorjanc gregor.gorjanc at bfro.uni-lj.si
Wed Nov 8 16:57:54 CET 2006


Jin,

Xiaodong Jin <close2ceo <at> yahoo.com> writes:
> how to realize the following SQL command in R?
> 
>   select distinct A, B, count(C)
>   from TABLE
>   group by A, B
>   ;
>   quit;
> 

if you want to perform such "query" on a data.frame! then

table(table$a, table$b)

will produce similar output, but in 2-way table, or this
for similar output

table(paste(table$a, "-", table$b))

Gregor



More information about the R-help mailing list