> On 10/12/07, Ben Bolker <bolker <at> ufl.edu> wrote:
> >
> >   Trying to find a quick/slick/easily interpretable way to
> > collapse a data set.
> >

Another alternative for SQL fans is the sqldf package.  I used the MySQL driver
here since SQLite does not support standard deviation. 


sqldf("select BROOD, avg(TICKS) as 'TICKS.mean', stddev_samp(TICKS) as
'TICKS.sd', HEIGHT, YEAR, LOCATION
 from h
group by BROOD, HEIGHT, YEAR, LOCATION",  drv="MySQL")

  BROOD TICKS.mean TICKS.sd HEIGHT YEAR LOCATION
1   501          0     0.00    465   95       32
2   502          0       NA    472   95       36
3   503          1     1.73    475   95       37



Chris

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to