[R] Sum list elements

baptiste auguie baptiste.auguie at googlemail.com
Tue Jul 27 14:44:12 CEST 2010


Hi,

do.call(sum, mylist)

?do.call

baptiste

On 27 July 2010 14:36, Nicola Sturaro Sommacal
<mailinglist at nicolasturaro.com> wrote:
> Hi!
>
> I have a list of 24 elements, all of the same type (dataframe, for example).
>
> I am looking for an alternative to mylist[[1]] + mylist[[2]] + ... +
> mylist[[24]] to obtain the sum.
>
> Anyone can help me?
>
> Thanks in advance.
>
> Nicola S.
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list