Re: [R] Sum list elements

2010-07-27 Thread baptiste auguie
Hi, do.call(sum, mylist) ?do.call baptiste On 27 July 2010 14:36, Nicola Sturaro Sommacal 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. > >

Re: [R] Sum list elements

2010-07-27 Thread Dimitris Rizopoulos
Have a look at Reduce(), e.g., Reduce("+", your.list) I hope it helps. Best, Dimitris On 7/27/2010 2:36 PM, Nicola Sturaro Sommacal 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]] + ... +

[R] Sum list elements

2010-07-27 Thread Nicola Sturaro Sommacal
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]]