Skip to content
Prev 155507 / 398502 Next

creating table of averages

Maybe something like this:

by(df[,c(77,81,86,90,94,98,101,106)],df$category,apply,2,mean)

...which would then need to be reformatted into a data frame (there is
probably an easy way to do this which I don't know).

aggregate seems like a more reasonable choice, but the function for
aggregate must return scalars, not rows...tapply doesn't take data.frame
inputs. Maybe someone else has a suggestion?

--Adam
On Tue, 9 Sep 2008, Lawrence Hanser wrote: