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; The functional equivalent of is statement in R on a dataframe is: TABLE$ones <- 1; aggregate(TABLE$ones, list(TABLE$a, TABLE$b), sum); HTH, Jens