[R] Best way to compute a sum

Duncan Murdoch murdoch.duncan at gmail.com
Thu Jun 24 23:13:39 CEST 2010


On 24/06/2010 4:57 PM, Peter Langfelder wrote:
> On Thu, Jun 24, 2010 at 1:50 PM, Duncan Murdoch
> <murdoch.duncan at gmail.com> wrote:
>   
>> On 24/06/2010 4:39 PM, Peter Langfelder wrote:
>>
>>     
>>> AFAIK the optimal way of summing a large number of positive numbers is
>>> to always add the two smallest numbers
>>>       
>> Isn't that what I said?
>>     
>
> I understood that you suggested to linearly sum the numbers from the
> smallest to the largest. That would take an initial sort and then a
> simple sum. My idea is to keep the order throughout. Apologies if I
> misunderstood.

Actually, I think I misunderstood you.  Sorry!

Duncan



More information about the R-help mailing list