[R] how to calculate mean into a list
jim holtman
jholtman at gmail.com
Wed Aug 29 02:06:24 CEST 2007
try:
colMeans(do.call('rbind', lapply(a0, mean)))
On 8/28/07, Weiwei Shi <helprhelp at gmail.com> wrote:
> Dear Listers:
>
> I have this task and suppose a0 is a list of 10 data.frames, I want to
> calculate like this
> > (a0[[1]]+a0[[2]]+..+a[[10]])/10
>
> Thanks.
>
> --
> Weiwei Shi, Ph.D
> Research Scientist
> GeneGO, Inc.
>
> "Did you always know?"
> "No, I did not. But I believed..."
> ---Matrix III
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>
--
Jim Holtman
Cincinnati, OH
+1 513 646 9390
What is the problem you are trying to solve?
More information about the R-help
mailing list