Thanks Rui, Greg, and Michael.
Your answers helped a lot!

Best,
Reeyarn

On Sun, Mar 25, 2012 at 1:02 AM, Rui Barradas <rui1174@sapo.pt> wrote:

> Hello,
>
>
> You can use sql with package 'sqldf'.
>  library(sqldf) # It needs package 'tcltk'
> ?sqldf
>  tbl <- data.frame(firm_id=rep(c(1,2), 10), value=rnorm(20))
>  sqldf("SELECT firm_id, count(*), avg(value), stdev(value)
>  FROM tbl
>  GROUP BY firm_id;")
>
> I've changed the name of your data.frame because 'table' is an R function.
>  Hope this helps,
>
> Rui Barradas
>
>

	[[alternative HTML version deleted]]

